random float number in C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main() {
    float random_float;

    // Use current time as seed for random number generation
    srand(time(NULL));

    // Generate a random float between 0 and 1
    random_float = (float)rand() / RAND_MAX;

    // Print the random float
    printf("Random Float: %f\n", random_float);

    return 0;
}