So here is my issue,
the range is 1 to 49, inclusive in an array.
You must input how many integers you wish to show on the output. (lets say 12 is your input).
The expected random output should be for example
------------------------
1
3
47
3
1
3
47
44
26
47
49
26
1 appears 2 times
2 appears 0 times
3 appears 3 times
.....
26 appears 2 times
....
44 appears 1 times
...
47 appears 3 times
48 appears 0 times
49 appears 1 times
----------------------------------
For a total of 12 times
Here is what i have so far.
Code:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int random[49];
int value;
int i;
int numtogen2;
printf("Enter the number of random integers to generate.\n");
scanf("%d",& numtogen2);
for(i=0;i<numtogen2;i++)
{
value=(rand()%49)+1;
printf("%d\n",value);
printf("%d is shown %d times\n", value, random);
}
}
My main issue is passing the output values into the array, I know im missing some code, just wondering what that would be or how it would look like.