Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <time.h>
- main(){
- int dieRoll[1000], dieFrequency[5], i = 0, sum = 0;
- srand(time(NULL));
- for(i = 0; i <= 999; i++) {
- dieRoll[i] = rand() % 6 + 1;
- }
- i = 0;
- for(i = 0; i <= 999; i++){
- dieFrequency[dieRoll[i]]++;
- }
- printf("%i", dieFrequency[2]);
- system("pause");
- }
Add Comment
Please, Sign In to add comment