Question: Help with these Exercise 3-1. When you use printf, the C++ compiler does not check your format string. See what happens if you try to

Help with these

Exercise 3-1.

When you use printf, the C++ compiler does not check your format string. See what happens if you try to display a value with type int using %f. And what happens if you display a double using %d? What if you use two format specifiers, but then only provide one value?

Exercise 3-2.

Write a program that converts a temperature from Celsius to Fahrenheit. It should (1) prompt the user for input, (2) read a doublevalue from the keyboard, (3) calculate the result, and (4) format the output to one decimal place. For example, it should display "24.0 C = 75.2 F".

Here is the formula. Be careful not to use integer division!

F = C * 9/5 + 32

Excersise 3-3

simply write a program that follows the output example given earlier in the exercise. Here it is again:

I'm thinking of a number between 1 and 100. Can you guess it?

Type a number: 45

Your guess is : 45

The number I was thinking of is: 14

You were off by: 31

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!