Firstly, you need to indent your code consistently, e.g.,
Code:
#include <stdio.h>
int input_number();
int main(void)
{
int numbers[100];
int c;
int b;
for (b = 0; b < 10; b++)
{
c = input_number();
if (c > 99)
{
numbers[0] = 0;
numbers[0]++;
}
else
{
numbers[c] = 0;
numbers[c]++;
}
}
printf("There are %d integers that are out of range\n", numbers[0]);
printf("There are %d %ds\n", numbers[c], c);
return 0;
}
int input_number()
{
int a;
printf("Input a positive integer greater than 0 ");
scanf("%d", &a);
return a;
}
Next, instead of repeatedly setting each element of numbers to 0, you should initialise numbers to hold 0s, as tabstop suggested:
Code:
int numbers[100] = {0};
Now, you can remove those lines that assign 0 to numbers[0] and numbers[c].
This line looks like it belongs in a loop:
Code:
printf("There are %d %ds\n", numbers[c], c);
A point to note: do you need to handle negative input? Even if you don't, you should.