0
Q:

how to generate random between 0 and 9 in c

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

int main()

{
    int randomnumber;
    srand(time(NULL));
    randomnumber = rand() % 10;
    printf("%d\n", randomnumber);
    return 0;
}
0

New to Communities?

Join the community