/* PROGRAMA QUE IMPRIME FRECUENCIAS
AUTOR: CARLOS E. LOPEZ */
#include <conio.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
main()
{
int conta=1;
int aleatorio=0;
int c1=0;
int c2=0;
int c3=0;
int c4=0;
int c5=0;
int c6=0;
printf("\n\n\t\tPROGRAMA QUE IMPRIME FRECUENCIAS\n\n\n");
srand(time(0));
for(conta=1;conta<=100;conta++)
{
aleatorio=1+(rand()%6);
switch(aleatorio)
{
case 1: c1++;
break;
case 2: c2++;
break;
case 3: c3++;
break;
case 4: c4++;
break;
case 5: c5++;
break;
case 6: c6++;
break;
}
}
printf("CARA\tOCURRENCIAS\n");
printf("1: \t%d\n",c1);
printf("2: \t%d\n",c2);
printf("3: \t%d\n",c3);
printf("4: \t%d\n",c4);
printf("5: \t%d\n",c5);
printf("6: \t%d\n",c6);
printf("\n\n\t\t");
system("PAUSE");
return 0;
}
AUTOR: CARLOS E. LOPEZ */
#include <conio.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
main()
{
int conta=1;
int aleatorio=0;
int c1=0;
int c2=0;
int c3=0;
int c4=0;
int c5=0;
int c6=0;
printf("\n\n\t\tPROGRAMA QUE IMPRIME FRECUENCIAS\n\n\n");
srand(time(0));
for(conta=1;conta<=100;conta++)
{
aleatorio=1+(rand()%6);
switch(aleatorio)
{
case 1: c1++;
break;
case 2: c2++;
break;
case 3: c3++;
break;
case 4: c4++;
break;
case 5: c5++;
break;
case 6: c6++;
break;
}
}
printf("CARA\tOCURRENCIAS\n");
printf("1: \t%d\n",c1);
printf("2: \t%d\n",c2);
printf("3: \t%d\n",c3);
printf("4: \t%d\n",c4);
printf("5: \t%d\n",c5);
printf("6: \t%d\n",c6);
printf("\n\n\t\t");
system("PAUSE");
return 0;
}