
/*roll dice using srand and rand functions*/

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SIZE 7

main()
{

   int face,roll,frequency[SIZE]={0};

   srand(time(NULL));

   for (roll=1; roll<=10000;roll++) {

       face = rand() % 6 + 1;

       frequency[face] += 1;
   }

  for (face=1;face<=6;face++)
  printf("The frequency for %d is %d\n",face,frequency[face]);

}

