a This word cannot be printed b x 60 c x 80 d x 50 e x 70 f 50 x 60 g50 x 80 h

A this word cannot be printed b x 60 c x 80 d x 50 e

This preview shows page 4 - 6 out of 6 pages.

a. This word cannot be printed b. x > 60 c. x > 80 d. x > 50 e. x > 70 f. 50 <x ≤ 60 g. 50 < x ≤ 80 h. 60 < x ≤ 80 i. x ≤ 50 j. x ≤ 60 Question 7 (10 points)What is the output of the following program#include <stdio.h>int main() {int x;printf(“Enter a value for x >”);scanf(“%d”, &x);switch(x) {case 1: x=x+1;case 3: x=x+2; case 5: if(x==4)x=x+6;break;case 6: x=x+3; default : x=x-1;}printf("%d\n",x);return 0;}Value of xtypedBy userProgramoutput123564 Word printed By the program Exact range of x values typed by the user. Select 1 choice East North West South Nowhere
Image of page 4
Question 8 (12 points)Write a c program that asks the user to enter a weekday initial (Use initials used in your class schedule i.e. S,U,M,T, and W). The user maytype the day initial as lower case or capital. Then your program will print the corresponding day name. Use switch statement and use default for invalid input.Samples of executing your program. 5
Image of page 5
Question 9 (20 points)The Body Mass Index (BMI) formula is an internationally used measure of obesity. Calculating body mass index requires only two measurements, height and weight. Your program should allow the user to enter the weight and height either in (pound, inch) or (kilogram, meter). The formula for computing BMI is as follows:22703)/(heightweightinpoundBMIin case weight in pounds and height in inches22)/(heightweightmkgBMIin case weight in kilograms and height in metersBMIWeight Status Below 18.5 Underweight18.5 -24.99 Normal25 - 29.99 Overweight30 and Above ObeseYour program should print one of the weight statuses indicated on the second column of the table above based on the value of BMI found.Here are some executions of the program 6
Image of page 6

You've reached the end of your free preview.

Want to read all 6 pages?

  • Fall '19
  • Kilogram, Body mass index

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture