Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- #define QTDE_NUMEROS 15
- int main() {
- int i, sorteado, freq[6]={0};
- srand(time(NULL));
- for(i=1; i<=QTDE_NUMEROS; i++) {
- sorteado = (rand() % 6) + 1;
- printf("%d ", sorteado);
- freq[sorteado-1]++;
- }
- printf("\nDistribuicao de frequencia dos numeros sorteados");
- for(i=0; i<6; i++)
- printf("\nQtde de vezes do numero %d: %d",i+1,freq[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement