Bmi calculator not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
22nd Aug 2018, 5:02 AM
Shivank Batra
3 Answers
+ 2
You should place parentheses around b*b. So instead of a/b*b, you would write a/(b*b). The order of operations is dividing a by b, then multiplying b by b again, giving you the original a value. With parentheses, b*b will be solved first, then a will divide by that value.
22nd Aug 2018, 5:07 AM
NULL
NULL - avatar
+ 1
Like NULL said, it's the parenthesis. Just remember that operators work the same in coding as they do in maths, ie Brackets Over Division, Multiplication, Addition and Subtraction (BODMAS).
22nd Aug 2018, 7:33 AM
Duncan
Duncan - avatar
0
thanks u !!!!!
22nd Aug 2018, 5:09 AM
Shivank Batra