0% found this document useful (0 votes)
26 views1 page

Solution To Question No.8: Program

This program accepts a person's height in meters and weight in kilograms as input from the user. It then calculates the person's body mass index (BMI) by dividing their weight in kilograms by the square of their height in meters. Finally, it prints out the calculated BMI value.

Uploaded by

pontas97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Solution To Question No.8: Program

This program accepts a person's height in meters and weight in kilograms as input from the user. It then calculates the person's body mass index (BMI) by dividing their weight in kilograms by the square of their height in meters. Finally, it prints out the calculated BMI value.

Uploaded by

pontas97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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