/* * if2.c */ #include // include functions in stdio.h when compiling int main(void) // header for funciton main: takes nothing returns int { int height, mass; // declare int variables height and mass int upperlimit, lowerlimit; // declare 2 more int variables upperlimit and lowerlimit printf("Enter someone's height in cm: "); //prompt user for input scanf("%d", &height); // store input at address of height printf("Enter someone's mass in kg: "); //prompt user for input scanf("%d", &mass); // store input at address of mass upperlimit=(height-90); // subtract 90 from height, and assign result to upperlimit if(mass <= upperlimit) // if value of upperlimit is greater than mass, enter loop { printf("The person you chose is probably not overweight.\n"); // print printf("But, tell the person to check if underweight.\n"); // print } if(mass > upperlimit) // if value of upperlimit is greater than mass, enter loop { printf("The person is probably overweight.\n"); // print printf("Suggest the person to do more exercise.\n"); } return 0; // return 0 to calling program }