Question: Write a program in C + + with two variables x and y of types float and double. The program should contain multiple assignment statements

Write a program in C++ with two variables x and y of types float and double.
The program should contain multiple assignment statements and multiple output statements. (No loops, please.)
The first two assignment statements will assign 1.0/11 to both x and y.
After that you should output x and y to the console with 20 digits precision.
Repeat the above nine more times, except use values 2.0/11,3.0/11,4.0/11,5.0/11,6.0/11,7.0/11,8.0/11,9.0/11 and 10.0/11 for x and y.
Look at your output from Part 1 and form a conjecture regarding the number of digits of precision (accuracy) that can be expected using variables of type float and double,

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!