How do i write a code for calculating bmi? Someone please help me. BMI=weight/(height*height). Weight in kg and height in cm. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do i write a code for calculating bmi? Someone please help me. BMI=weight/(height*height). Weight in kg and height in cm.

Am new to programming and doing C

28th Apr 2019, 10:52 AM
Zabu
2 Answers
+ 7
#include<stdio.h> int main() { int height; float w8, bmi; printf("enter the HEIGHT in cm\n"); scanf("%d",&height); printf("enter the WEIGHT in Kg\n"); scanf("%f",&w8); bmi=w8/(height*height); printf("BMI is ℅f", bmi); return 0; }
28th Apr 2019, 11:03 AM
Mohd Abdul Sameer
Mohd Abdul Sameer - avatar
+ 1
Bro tks alot really appreciate it
28th Apr 2019, 11:05 AM
Zabu