#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
srand(time (NULL) );
int dice1,dice2,sum,i,j;
int frequency[11]={0};
for (j=0;j<36000;j++){
dice1=1+rand() %6;
dice2=1+rand() %6;
sum=dice1+dice2;
if (sum==2){
frequency[0]++;
}
if (sum==3){
frequency[1]++;
}
if (sum==4){
frequency[2]++;
}
if (sum==5){
frequency[3]++;
}
if (sum==6){
frequency[4]++;
}
if (sum==7){
frequency[5]++;
}
if (sum==8){
frequency[6]++;
}
if (sum==9){
frequency[7]++;
}
if (sum==10){
frequency[8]++;
}
}
j=2;
for (i=0;i<9;i++){
printf("Frequency of number %d is \t%d\n", j,frequency[i]);
j++;
}
printf("\n");
system("PAUSE");
return 0;
}