Arduino Projects    |   Raspberry Pi  |     Electronic Circuits   |    AVR    |    PIC    |    8051    |    Electronic Projects

Read the age of 100 persons and count the number of person in the age group 50 -60

Code: 
/* C Program: read the age of 100 persons and count
the number of person in the age group 50 -60. */
 
#include<stdio.h>
#include<conio.h>
void main()
{
   int age, count =0, i,n;
   clrscr();
   printf("Enter How many person:-> ",i);
   scanf("%d",&n);
 
   for(i=1;i<=n;i++)
   {
     printf("Enter age of %d person :-> ",i);
     scanf("%d",&age);
     if(age>=50&&age<=60)
count++;
   }
   printf("Total person in the age group 50 to 60 = %d\n",count);
   getch();
}
You are here