Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <time.h>
- int main()
- {
- int i;
- time_t t;
- // this creates your random number generator based on a new variable (time)
- // since time changes constantly, the numbers generated will always be different
- srand(time(&t));
- for( i = 0 ; i < 10 ; i++ ) {
- printf("%d\n", rand()%6+1);
- }
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement