0
Plase help me in BMI Calculator
6 Antworten
+ 2
Show your code first then we can help you.
+ 1
While printing , match the case as required in description.
"Underweight" capital U,..
"Normal" ,
"Overweight" , "Obesity"..
+ 1
C ++
int w , h ;
cin >> w ;
cin >> h ;
int BMI = w / (h * h);
If (BMI < 18.5){
cout << "Underweight" << endl;
}
else if ( BMI >= 18.5 && BMI < 25){
cout << " Normal" << endl;
else if ( BMI >= 25 && BMI < 30){
cout << " Overweight" << endl ;
else {
cout << "Obesity" << endl ;
+ 1
hossein abazary
Try this:
weight = int(input());
height = float(input());
bmi = weight/float(height*height);
if bmi<18.5:
print('Underweight')
elif bmi>=18.5 and bmi<25:
print("Normal")
elif bmi>=25 and bmi<30:
print('Overweight')
else:
print('Obesity')
+ 1
To the guys and girls who directly post their answer: hey we knew that you guys are good at coding .. But please don't directly post the answers give them suggestions or ask them to show their code... U guys are making them lazy
0
w=int(input())
h=float(input())
bmi=w/h**h
if bmi<18.5:
print("underweight")
elif bmi >=18.5 and bmi <25:
print("normal")
elif bmi >=25 and bmi <30:
print("overweight")
elif bmi >=30:
print("obesity")