Home > Back-end >  C language to calculate index weight
C language to calculate index weight

Time:06-06

Bosses find a mistake!!!!!!

CodePudding user response:

Int/int will get int, you only need to consider change the BMI to float, calculation to convert the data types,
Such as BMI=weight/(double) (height * height)

CodePudding user response:

Don't post code to calculate or shoot figure...
If judgment not add double quotation marks inside the
Suggest all use floating-point, BMI and height and weight were not an integer

CodePudding user response:

refer to the second floor yhbear response:
not post code to calculate or figure...
If judgment not add double quotation marks inside the
Suggest all use floating-point, BMI and height and weight were not integer

It is no use to the relevant function and you don't reference math.h h the
Want to use, can use a pow () power function

CodePudding user response:

(1) after removing two header file
2 variables to float
(3) four if changing the if - else can a bit faster

CodePudding user response:

BMI suggested definition into float type, because want and floating point comparisons,

In addition
 BMI=weight * 1.0/(height * height); 

Ensure the back of the operation is a floating-point operation

CodePudding user response:

Why will display a low weight overweight and obesity

CodePudding user response:

refer to the second floor anoraks Bear response:
not post code to calculate or figure...
If judgment not add double quotation marks inside the
Suggest all use floating-point, BMI and height and weight were not integer

Why will display a low weight overweight and obesity

CodePudding user response:

refer to the second floor anoraks Bear response:
not post code to calculate or figure...
If judgment not add double quotation marks inside the
Suggest all use floating-point, BMI and height and weight were not integer

To figure has to endure, or side put, don't know what to write code is cervical vertebra is bad? !

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related