I am a student in a computer programming class. I was instructed to write a program that would allow the user to input numbers and the program would output the sum of those numbers. I wrote the program up but keep getting this error message: error C2447: '{' : missing function header (old-style formal list?). I have no clue what this means. Can someone please help? I am a beginner so please keep it simple. Here is the program I wrote:
#include <stdio.h>
int input_number();
int main(void)
{
int numbers[100];
int counter;
int sum;
int number_elements;
printf("The number of elements you want to use is ");
scanf("%d",number_elements);
sum=0;
for (counter=1; counter<=number_elements; counter++)
{
numbers[counter]=input_number();
sum=sum+numbers[counter];
printf("The sum is %d",sum);
}
return 0;
}
int input_number();
{
int b;
printf("Input a number ");
scanf("%d",&b);
return b;
}