Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 14 Online
OpenStudy (anonymous):

can anyone tell me the problem of this programme? #include int main () { double a,b,bmi; printf("enter your weight(kg) and height(m)\n" ,a ,b); scanf("%d%d" , &a ,&b); bmi = a/(b*b); printf("your BMI :\n" ,bmi); if (bmi<18.5) printf("you are under weight\n"); if (bmi>=18.5 && bmi<=24.9) printf("you are normal\n"); if (bmi<=29.9 && bmi>=24.9); printf("you are overweight\n"); if (bmi>=29.9) printf("you are obese\n"); return 0; }

OpenStudy (rsmith6559):

printf("enter your weight(kg) and height(m)\n" ,a ,b); I see no reason for a and b in this statement. scanf("%d%d" , &a ,&b); %d is for integers, %f is for float. "%d%d" doesn't have any separation between the two numbers. "%d %d" separates the integers with a space. if (bmi<=29.9 && bmi>=24.9); if statements don't have a semi-colon.

OpenStudy (anonymous):

thank u so much

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!