write a program that first displays messages asking for a person\'s name, weight
ID: 3563911 • Letter: W
Question
write a program that first displays messages asking for a person's name, weight in pounds, and weight in inches. the program that calculates and displays a person's body mass index (BMI) together with the name. The BMI is calculated using the following formula: BMI=703*weight/height^2 write a program that first displays messages asking for a person's name, weight in pounds, and weight in inches. the program that calculates and displays a person's body mass index (BMI) together with the name. The BMI is calculated using the following formula: BMI=703*weight/height^2Explanation / Answer
#include <stdio.h>
int main(){
char *name;
float height , weight;
printf("Please enter your name:");
scanf("%s" , name);
printf("Please enter your height:");
scanf("%f" , &height);
printf("Please enter your weight:");
scanf("%f" , &weight);
float BMI = 703*weight / (height*height);
printf("your name: %s" , name);
printf("your BMI: %f" , BMI);
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.