23. Read five persons height and weight and count the number of person having height greater than 170 and weight less than 50,

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,str[5][2],count=0;
printf("Enter Height and Weight:\n");
for(i=0;i<5;i++)
{
for(j=0;j<2;j++)
{
scanf("%d",&str[i][j]);
}
}
for(i=0;i<5;i++)
{
for(j=0;j<2;j++)
{
if(str[i][0]>=170 && str[i][j]<=50)
{
count++;
}
}
}
printf("Number of Students= %d",count);
getch();
}


#OUTPUT:


Comments

Popular posts from this blog

12. Write a program to read marks from keyboard and your program should display equivalent grade according to following table(if else ladder) Marks Grade 100 - 80 Distinction 79 - 60 First Class 59 - 40 Second Class < 40 Fail

13. Write a c program to prepare pay slip using following data. Da = 10% of basic, Hra = 7.50% of basic, Ma = 300, Pf = 12.50% of basic, Gross = basic + Da + Hra + Ma, Nt = Gross – Pf.