For this task , my classmates and I were instructed to create a program that asks the user for a number and then calls functions to calculate the square and cube roots of a number and prints them out.

For this quiz , I created the program with two functions:

double square_root(double x) {} // returns the square root of x

double cube_root(double x) {} // returns the cube root of x

-Important notes:

I had to add a new library to my program , in order to use the square and cube roots functions:

#include <cmath> // Declares a set of functions to compute common mathematical operations.

The progam does not accept negative numbers. It asks again for a positive number.

Here you will find my code and some captures:

#include <iostream>
#include <cmath> // Declares a set of functions to compute common mathematical operations.
using namespace std;

## Leave a Reply