Create a program that takes the square root of a number using the concepts of exception handling. In the implementation of main, you will call the function Sqrt and pass as argument an integer value (positive or negative). If all goes well, main will display the square root of the value provided. The function Sqrt will throw the integer value -9999 as error if the value provided by main is negative. If it is not negative, then it will take the square root of the value using the function Sqrt from the cmath library (Note: You're making your own Sqrt function and using the cmath's function Sqrt inside Sqrt). main should appropriately handle ANY exception thrown by Sqrt.
c++
Create a

Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images









