Greetings:
I am having some errors on this code:
Any ideas what is missing in the code?
Thanks,
Dani
`
#include<stdio.h>
void func_count(int);
int main( )
{
int i, num;
for(i = 1; i < 21; i ++ )
{
scanf(“%d”, &num);
if(num < 1 || num > 6)
printf(“Error: Invalid number %d\n”);
else
func_count(num);
}
func_count(0);
return 0;
}
func_count(int n) /* count occurrances of n */
{
static int count2, count5;
count2 += ( n == 2);
count5 += ( n == 5);
if( n== 0)
{
printf(“There are %d occurances of 2\n”, cnt_2);
printf(“There are %d occurances of 5\n”, cnt_5);
}
return;
}
`