Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- int main(void)
- {
- // seed with random time
- srand(time(NULL));
- // andom number 1 - 6
- int rand_num = rand() % 6 + 1;
- // print number to screen
- printf("random number = %d\r\n", rand_num);
- // pause before exit
- getchar();
- return 0;
- }
Add Comment
Please, Sign In to add comment