cout << "This program will print a random number." << endl;
srand((unsigned)time(0));
int rnum = (rand()%10) + 1;
cout << "\nGenerated random number: " << rnum << endl;
_getch();
return 0;
I understand it states that it prints a random number, but what I want to know is *how* it does it. I've never really seen srand used that way. I see they are declaring integer rnum for random number, followed by a rand statement that I do not understand.