Question: C++ C++ The following code is intended to find the perimeter and area of a circle. However, it fails to do so. Correct the errors
C++
C++
The following code is intended to find the perimeter and area of a circle. However, it fails to do so. Correct the errors in the code. Also, do not modify the numeric values assigned to the variables in the code. After correcting the code, what is the output? Please submit the screenshots of the corrected code and output.
const double PI = 3.1416;
double &radius;
cout << fixed << showpoint << setprecision(2);
radius = new double;
radius = 3.2;
cout << "Perimeter: " << 2 * PI * radius << endl;
cout << "Area: " << PI * radius * radius << endl;
Output:
_____________
_____________
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
