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 with this code so it does this?
Code: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; i++) { if (a[i] == num) { ++count; /* it was found */ } } return(count); }