if i enter 60 as weight in kg and 1.8 as height in meter the why the bmi is showing 60 instead of 18.51. Find the problem plz... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

if i enter 60 as weight in kg and 1.8 as height in meter the why the bmi is showing 60 instead of 18.51. Find the problem plz...

https://code.sololearn.com/c9OUp1vAqq4H/?ref=app

1st Sep 2022, 5:15 PM
Ashish Raj
Ashish Raj - avatar
2 Answers
+ 3
Square the height first, then do the division. See the difference ... This is what happens 60 / 1.8 -> 33.333 33.333 * 1.8 -> 60 And this is what you want to happen 60 / ( 1.8 * 1.8 ) 60 / ( 3.24 ) -> 18.51
1st Sep 2022, 5:53 PM
Ipang
+ 2
w/h*h=w w(h*h)=bmi
1st Sep 2022, 5:49 PM
Oma Falk
Oma Falk - avatar