C-PROGRAMMING.....
1.Write a program in c to count the number of student having age less than 25 and weight less than 50 kg out of 5 by using do while loop.
Ans:-#include<stdio.h>
#include<conio.h>
void main()
{
int age,weight,count,i=1:
clrscr():
printf("plz input the data of student"):
do
{
scanf("%d%d",&age,&weight):
if(age<25&&weight<50){
count=count++
i++
}
while(i<=5)
{
printf("no. of students with age<25 and weight<50=%d\n", count):
getch():
}
Ans:-#include<stdio.h>
#include<conio.h>
void main()
{
int age,weight,count,i=1:
clrscr():
printf("plz input the data of student"):
do
{
scanf("%d%d",&age,&weight):
if(age<25&&weight<50){
count=count++
i++
}
while(i<=5)
{
printf("no. of students with age<25 and weight<50=%d\n", count):
getch():
}
Always give ur best. Nice
ReplyDelete