WAP to read the age of 10 persons and count the number of person in the age group 50-60 (Use For and Continue Statement)


void main()
{
int i,age,c=0;
clrscr();
for(i=1; i<=10; i++)
{
printf("Enter the age of the person");
scanf("%d", &age);
if(age>50 && age<60)
{
c++;
continue;
}
}

printf("  %d",c);
getch();
}

2 comments: