This program I wrote has the following error:
(33,5):Declaration syntax error
(64,2):Declaration missing ;
#include <stdio.h>
#include <conio.h>
int range1(int a);
int range2(int b);
int range3(int c);
int range4(int d);
int main()
{
int in, ctr, ctr1=0, ctr2=0, ctr3=0, ctr4=0, ctr5=30;
for(ctr=1;ctr<=30;ctr++)
{
printf("Enter %d integer values within 1-200: ", ctr5--);
scanf("%d", &in);
}
clrscr();
ctr1=range1(in);
ctr2=range2(in);
ctr3=range3(in);
ctr4=range4(in);
printf("\nNumbers inputted within the range of 1-50 = %d", ctr1);
printf("\nNumbers inputted within the range of 51-100 = %d", ctr2);
printf("\nNumbers inputted within the range of 101-150 = %d", ctr3);
printf("\nNumbers inputted within the range of 151-200 = %d", ctr4);
getch();
int range1(int a)
{
int a, ans1;
if((a>=1)&&(a<=50))
ans1=ans1+1;
return ans1;
}
int range2(int b)
{
int b, ans2;
if((b>=51)&&(b<=100))
ans2=ans2+1;
return ans2;
}
int range3(int c)
{
int c, ans3;
if((c>=101)&&(c<=150))
ans3=ans3+1;
return ans3;
}
int range4(int d)
{
int d, ans4;
if((d>=151)&&(d<=200))
ans4=ans4+1;
return ans4;
}
}