#include<stdio.h>
#include<conio.h>
main()
{
float x,y,z;
clrscr();
printf("\nThis program calculate if you are Underweight,Healthy or Overweight");
printf("\n\n Enter your weight in kilograms:");
scanf("%f",&x);
printf("\n\n Enter your weight in meters:");
scanf("%f",&y);
z=((y*y)/x);
if(z<20){
printf(" the Quetelet-index is: %f",z);
printf("\n\n\tUnderweight");
}
else{
printf("\n the quetelet-index is : %f",z);
printf("\n\n\tOverweight");
}
getch();
return 0;
}
-jOHn BeneDict-
0
Newbie Poster
Recommended Answers
Jump to PostI can't help you with the math (have no clue what a quetelet is) but you will need to add a getch() immediately following that scanf() to remove the <Enter> key from the keyboard buffer. scanf() does not do that for you.
All 4 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Zababa
0
Newbie Poster
Dave Sinkula
2,398
long time no c
Team Colleague
Zababa
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.