Question: Write a C + + program that calculates an absolute number, a power, a square root, rounding up , rounding down, and rounding to the

Write a C++ program that calculates an absolute number, a power, a square root, rounding up, rounding down, and rounding to the nearest by calling predefined functions. You must include cmath to use mathematical functions. (#include )
List of functions
double abs (double x); // returns the absolute value of x: (|x|)
double pow (double b, double e); // returns b raised to the power e: (b^e)
double sqrt (double x); // returns the square root of x: ((2&x))
double round (double x); // returns the integral value that is nearest to x
double ceil (double x); // returns x upward
double floor (double x); // returns x downward
Sample Output: Red colored texts are user inputs. Other texts are the output of the program.
|-21|=21
2^3=8
A square root of 16=4
Rounding up 3.5=4
Rounding down 3.5=3
Rounding 3.5 to the nearest integer =4

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!