come creare variabili casuali in c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main() {
// Seed the random number generator
srand(time(NULL));
// Generate a random integer
int randomInteger = rand();
// Generate a random float
float randomFloat = (float)rand() / RAND_MAX;
// Print the random values
printf("Random Integer: %d\n", randomInteger);
printf("Random Float: %f\n", randomFloat);
return 0;
}