Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- #include <math.h>
- int main()
- {
- int i;
- int diceRoll;
- for(i=0; i<20; i++){
- //returns a random integer from 0 to 32767
- printf("%d \n", rand() );
- //returns a number 1-6
- diceRoll = ( rand()%6 ) + 1;
- printf("You rolled a %d \n", diceRoll );
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement