Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
in c++ please Program 1. Write a program that prints out Pl as a type double and a type float EXACTLY as shown below. Your
in c++ please Program 1. Write a program that prints out Pl as a type double and a type float EXACTLY as shown below. Your program should have ONE cout statement within a loop which alters the width and precision each time through the loop. Do not write 10 separate cout statements for this problem. Show the output in a table that increases the precision from 1 to 10 as shown below. Use dash (*) as the fill character. Note the differences as the precision gets larger. Use the following two variables for PI. double PID = 3.14159256359; float PL F = 3.14159256359; DOUBLE FLOAT ----3.1--- --3.1 -------3.14--------- -3.14 -------3.142------ -3.142 ---3.1416-- -3.1416 ----3.14159--- -3.14159 -------3.141593-------3.141593 -------3.1415926------3.1415925 -------3.14159256-----3.14159250, -------3.141592564----3.141592503 ----3.1415925636---3.1415925026 Press any key to continue
in c++ please
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started