I need to be able to count the number of occurrances of the numbers 1->9 in the array 'a' and output them in the form
printf("\n %d occurrs : %d times\n",num,occurrances)
What do i need to do...
Type: Posts; User: legacye
I need to be able to count the number of occurrances of the numbers 1->9 in the array 'a' and output them in the form
printf("\n %d occurrs : %d times\n",num,occurrances)
What do i need to do...
I tried the total [nums] etc...with and without Salems suggested way and it keeps crashing ...and doesnt count the numbers correctly
int count_num(int a[], int range, int num)
/* checks array...
i Tried that Salem, but all it does is extend the output past 9 (up to the maximum value in the array)..it doesnt help the functionality of occurrances at all...
This is the section that does the count work:
int count_num(int a[], int range, int num)
/* checks array a for number of occurrances of value */
{
int i, count=0;
for (i=0; i<range;...
Count_nums in an array
---------------------------------------------------------
Hi..i need to get a solution to this pretty trivial problem asap.
This is a random number generator that has...