I need to Generate 1000 random numbers between 0 and 1. I got this part.
Next i need to identify the probabilty of having a head or a tail if i flipped a coin.
Also i dentify the probabibilty of a side of a six faced die.
I need [to use random numbers\
Code:
#include <stdio.h>
#include<stdlib.h>
int main()
{
float sum=0, average;
int i;
for (i=0; i<1000; i++) sum=sum;
for (i=0 ;i<1000; i++)
printf("%f\n", 1.0*rand()/RAND_MAX);
printf("\nMAX = %d\n" , RAND_MAX);
printf("The probability for having a Heads or Tails is:\n");
printf ("HEADS TAILS\n");
printf ("---- -----\n");
printf(" %d %d\n");
return 0;
}