0% found this document useful (0 votes)
14 views2 pages

Sonali 1

The document is an assignment by Sonali Ajit Pisal from BCA-1(B) that includes a C program for calculating Body Mass Index (BMI). It prompts the user for weight and height, computes the BMI, and categorizes the result into underweight, normal weight, overweight, or obese. The program uses standard input and output functions to display the BMI and its category.
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)
14 views2 pages

Sonali 1

The document is an assignment by Sonali Ajit Pisal from BCA-1(B) that includes a C program for calculating Body Mass Index (BMI). It prompts the user for weight and height, computes the BMI, and categorizes the result into underweight, normal weight, overweight, or obese. The program uses standard input and output functions to display the BMI and its category.
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/ 2

ASSIGNMENT NO:3

Name:Sonali.Ajit.pisal
Class:BCA-1(B) Roll No:74

Q.Given an input positive integer number,display odd numbers from in the range [1,n]?
#include<stdio.h>
int main() {
float weight, height, bmi;

// Input weight in kilograms


printf("Enter your weight in kilograms: ");
scanf("%f", &weight);

// Input height in meters


printf("Enter your height in meters: ");
scanf("%f", &height);

// Calculate BMI
bmi = weight / (height * height);

// Display BMI value


printf("Your BMI is: %.2f\n", bmi);

// Determine BMI category


if (bmi< 18.5) {
printf("You are underweight.\n");
} else if (bmi>= 18.5 &&bmi< 25) {
printf("You have a normal weight.\n");
} else if (bmi>= 25 &&bmi< 30) {
printf("You are overweight.\n");
} else {
printf("You are obese.\n");
}

return 0;

Output:

You might also like