Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int dado ()
- {
- return (rand() % 6 + 1) ;
- }
- int main ()
- {
- int soma = 0 , n , i , num ;
- printf ("Quantos lançamentos? ") ;
- scanf ("%d" , &n) ;
- for (i = 0 ; i < n ; i++) if (dado() == 6) soma++ ;
- printf ("A face seis saiu %d vezes.\n" , soma) ;
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment