Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int main(void)
- {
- int input;
- scanf("%d", &input);
- int i;
- int roll;
- time_t t;
- int sum = 0;
- srand((unsigned) time(&t)); // the seed for the random number generator based on the current time
- for( i = 0; i < input; i++)
- {
- roll = (rand() % 11 + 1); // random number generator
- sum += roll;
- printf("You Rolled : %d\n", roll);
- }
- printf("The Total Turn Score is : %d", sum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement