C Program to Find the Number of Persons in Different Age Group

0
4
digitalample eye
Write a program using C language to read the age of 100 persons and count the number of persons in the age group between 50 and 60. Use the ‘For’ and ‘Continue’ statements.

C program to read the age of 100 persons and count the number of person in the age group between  50 and 60. 
C Program to read the age of 100 employees and count the number of person in the age group from 50 to 60
Source code, 

#include <stdio.h>
#include <conio.h>
void main()
{
int age[100],count=0,i;
clrscr();
for(i=0;i<100;i++)
{
printf("Enter the age of person");
scanf("%d",&age[i]);
}
for(i=0;i<100;i++)
{
if(age[i]>=50 && age[i]<=60)
count=count+1;
else
continue;
}
printf("No of persons in the age between 50 and 60=%d",count);
getch();
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here