Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Solution to Question No.

8 :
Program:
/* Program to accept the height and weight of aperson as inputs and print
the BMI */
#include<stdio.h>
void main()
{
float h,w,BMI;
clrscr();
printf("Enter the height(m) and weight(kg) of the person:");
scanf("%f %f",&h,&w);
BMI=w/(h*h);
printf("The BMI of the person is: %f kg/m^2",BMI);
getch();
}

You might also like