Exam (401).pdf - Question Write a program that requests your height in inches and your name and then displays the information in the following form

Exam (401).pdf - Question Write a program that requests...

This preview shows page 1 - 3 out of 3 pages.

Question: Write a program that requests your height in inches and your name, and then displays the information in the following form: Dabney, you are 6.208 feet tall Use type float, and use / for division. If you prefer, request the height in centimeters and display it in meters. Answer : Program Plan: • Create a with .c extension • Write header files at the header section. • Declare variable to hold the firstname , as string; height and height_feet floating format. • In main function prompt user for firstname and height input as float values. • Finally print it to firstname and height_feet as required format “firstname,You are height_feet tall†± . Program Code: /********************************************************** * Program that reads user for firstname and height * * input as float values and height of user. Print it to * * firstname and height_feet as required format * * “firstname,You are height_feet tallâ€
Image of page 1
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

  • Summer '16
  • boer
  • C preprocessor, Dabney

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes