#include #include #include int main() { srand ( time(NULL) ); // initialize the random number generator int r = rand()%10+1; // generate a random number from 1 to 10 printf("r=%d\n", r); system("pause"); }