Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h> /* srand, rand */
- #include <time.h>
- int main ()
- {
- int RandomNum;
- /* Seed the random generator */
- srand (time(NULL));
- /* Generate a number from 1 to 10 */
- RandomNum = rand() % 10 + 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement