We provide Engineering,HSEB notes, tutorials which can be helpful for students during college life.
Friday, April 10, 2015
6. Write a program using C language to read the age of 100 persons and count the number of persons the age group between 50 and 60.Use "for" and "continue" statements.
#include<stdio.h>
#include<conio.h>
void main()
{
int age[100],i,n,count=0;
clrscr();
printf("\n Input age of 100 persons:-");
for(i=0;i<100;i++)
scanf("%d",&age[i]);
for(i=0;i<100;i++)
{
if(age[i]>=50&&age[i]<=60)
count++;
else
continue;
}
printf("There are %d persons whose age is in between 50 and 60 years",count);
getch();
}
Subscribe to:
Post Comments (Atom)
Thank you
ReplyDeleteTHANKS
ReplyDeleteThanks
ReplyDeleteThanks
ReplyDeletewas quite helpful even for the love story blog writer
ReplyDeleteI think please please include also run option to direct chake program is correct or not
ReplyDeleteOtherwise
BSdk
ReplyDelete