/* * if1.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 lowerlimit=(height-120); // subtract 120 from height, and assign result to lowerlimit if(mass <= upperlimit) // if value of upperlimit is greater than mass, enter loop { if(mass >= lowerlimit) { printf("Their mass is probably appropriate.\n"); // print } else { printf("Have an ice cream milkshake.\n"); } } else { printf("The person could be overweight.\n"); printf("More exercise?\n"); } return 0; // return 0 to calling program }