c how to generate random number from 1 to 5 code example
Example: 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;
}