Question: In this program, you will add two user entered heights in feet'inches format ( eg: 5 ' 1 0 ' ' ) and print the
In this program, you will add two user entered heights in feet'inches" format eg: and print the sum of the two heights in the feet'inches" format as well as in centimeters.
Write your C program called LabCcpp that does the following:
Prompt for and read in first height using printf and scanf appropriately. Use integer variables to store feet and inches for the first height feet and inches You need to use the correct format specifier in scanf to scan the two values.
Prompt for and read in second height using printf and scanf appropriately. Use integer variables to store feet and inches for the second height feet and inches
Compute the sum of the two user entered heights.
For calculating sum in feet'inches" format, add two feet and two inches of the two heights in two integer variables totalFeet and totalinches
Also, compute the carryover after you sum the inches of the two heights because foot inches. For example, if user enters and for first and second heights respectively, then the sum should be instead of
Sample Output:
$ aout
Enter first height format: :
Enter second height format: :
Sum of two heights centimeters
$ aout
Enter first height format: :
Enter second height format: :
Sum of two heights centimeters
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
