I am trying to write the code to find the frequency of real random number generated.It does not give any error but on compilation it shows blank. Here is the code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
int i,j;
float randomNumber;
float array_1[101];
float *array_2[101];
//float array_3[101];
int count[101]={0};
srand ((unsigned) time(NULL));
for(i =0; i<100; i++)
{
randomNumber = (rand() %100-1) ;
printf("Index[%d] = %f\n",i,randomNumber);
array_1[i]= randomNumber++;
array_2[i]=NULL;
//array_2[i]= &array_1[i];
for(j=0;j<100;j++)
{
//for(k=1;k<100;k++)
//{
if(array_1[j]==*array_2[j])
{
//array_3[j]=*array_2[j];
count[j]=count[j]+1;
}
else
{
count [j]=0;
}
}
}
for (j=1; j<100; j++)
{
*array_2[j]= (float)(j);
j++;
}
for(j=1; j<100; j++)
{
printf("The number [%f] has been randomly generated[%d]times \n",array_2[j],count[j]);
}
return 0;
}