Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Extend the inchtocm.c program given in Figure 2-5 so that it reads in two input values: the number of feet, followed on a separate

image text in transcribedimage text in transcribedimage text in transcribed

3. Extend the inchtocm.c program given in Figure 2-5 so that it reads in two input values: the number of feet, followed on a separate line by the number of inches. Here is a sample run of the program: This program converts from feet and inches to centimeters. Number of feet? 52 Number of inches? 11 The corresponding length is 180.34 cm. * File: inch tocm.c * This program reads in a length given in inches and converts it * to its metric equivalent in centimeters #include #include "genlib.h" #include "simpio.h" main() double inch, cm; printf("This program converts inches to centimeters. In"); printf("Length in inches?"); inch = GetReal(); cm = inch * 2.54; printf("%gin = % gcmin", inch, cm): FIGURE 2-5 inchtocm. * File: inch tocm.c 3. * This program reads in a length given in inches and converts it * to its metric equivalent in centimeters. Extend the inchtocmc program given in Figure 2-5 so that it reads in two input values: the number of feel, followed on a separate line by the number of inches. Ilere is a sample run of the program: #include #include "genlib.h" #include "simpio.h" This program converts from feet and inches to centimeters. Number of feet? 5 . Number of inches? 11 The corresponding length is 180.34 cm. main() double inch, cm; printf("This program converts inches to centimeters. In"); printf("Length in inches?"); inch = GetRcal(); cm = inch * 2.54; printf("%gin = %gcmin', inch, cm)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions