A program that calculates the square, cube and square root of a given number
💓💓💓💓
Hello, dear ones!
The following code can be used to calculate the square, cube and square root of a given number.
Note: The above program will return the square, cube, and square root of a given number because all the following three functions are being called, i.e.
calc.square()
calc.cube()
calc.sqrt()
*If you want to find the square of a given number only, put the given number in the Calculator class and call the respective function. In this case it is;
calc.square()
*If you want to find both the square and cube of a given number, put the given number in the Calculator class and call the respective functions. In this case, it is;
calc.square()
calc.cube()
I am sure you got the point. 👍👍👍👍💓
Comments
Post a Comment
Write something to CodeWithAbdur!