Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int flip();
- int main ()
- {
- int frequencyTesta = 0;
- int frequencyCroce = 0;
- int roll;
- int face;
- for(roll = 1; roll <= 100; roll++)
- {
- face = 1 + rand() % 2;
- switch (face)
- {
- case 0:
- ++frequencyCroce;
- break;
- case 1:
- ++frequencyTesta;
- break;
- }
- int flip();
- }
- printf("%s%13s\n", "Face", "Frequency");
- printf(" 0%13d\n", frequencyCroce);
- printf(" 1%13d\n", frequencyTesta);
- system("pause");
- return 0;
- }
- int flip()
- {
- int face;
- if(face == 0)
- return 0;
- if(face == 1)
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement