im trying to get this to run a scan of user enterd stats then calculate the body mass index's of the height in increments of 3 inches with weight in increment of 10's and say whether they are statistically overweight, like this :
5 3 150 26.5684 overweight
5 3 160 28.3396 overweight
5 6 140 22.5941 not overweight
5 6 150 24.2080 not overweight
here is what i have, but i cant find the errors is compiles in lines 66 and 107, any help would be greatly appreciated
Code:
#include <stdio.h>
#include <math.h>
int main()
{
int i, /* inches variable2 */
loheightfeet, /* low height in feet and inches*/
hiheightfeet, /* high height in feet and inches*/
loweight, /* low weight in pounds */
hiweight, /* high weight in pounds */
inches; /* height in inches */
float bmi; /* bmi */
/* get height and weight */
printf("Please enter low height in feet: ");
scanf("%d", &loheightfeet);
printf("please enter high height in feet: ");
scanf("%d", &hiheightfeet);
printf("Please enter low weight in pounds: ");
scanf("%d", &loweight);
printf("Please enter high weight in pounds: ");
scanf("%d", &hiweight);
for( i=inches, i<= hiheightfeet * 12, i=i+3){
printf(" %d/12 %num ", inches);
while( loweight <= hiweight ) {
/* calculate BMI */
inches = loheightfeet * 12;
bmi = 703.0 * loweight / (float) (inches * inches);
/* add 5 to loweight */
loweight = loweight +10;
/* indicate whether user is overweight */
if (bmi > 25.0) {
printf(" %d %.4f overweight.\n", loweight, bmi);
}
if (bmi < 25.0) {
printf(" %d %.4f not overweight.\n", loweight, bmi );
}
}
printf("/n")
}
return 0;
}