I want the program to get the user's height and weight then input that into the bmi formula then output the result.
The height question works fine but when you enter a number into the weight question and press enter, it just makes a new line. Once you enter another number, it sets that to bmi
and prints that.
#include<stdio.h>
int main()
{
int h, w, bmi;
printf("What is your height (in inches)? ");
scanf("%d", &h);
printf("What is your weight? ");
scanf("%d", &w);
bmi = (w/(h*h))*703;
scanf("%d", &bmi);
printf("\t\tBMI\n");
printf("US: %d\n", bmi);
}