I figured it out.
Code:
#include <stdio.h>
int input_number(void);
int main(void)
{
int numbers[10000]={0};
int b,c;
for(b=0;b<10000;b++)
{
c=input_number();
if (c<=9&&c>0)
{
numbers[c]++;
}
if(c<1||c>9)
{
int a;
for (a=1;a<=9;a++)
{
printf("There are %d %ds\n",numbers[a],a);
}
}
}
return 0;
}
int input_number()
{
int a;
printf("Input a positive integer ");
scanf("%d",&a);
return a;
}
I had one of those ifs outside the for loop and it would just terminate, lol.
I take that back, it doesn't actually work, it just prints the count, then keeps asking for an input....