.) Write a complete C program in one file which takes a double value from the user, cubes it, and prints the result. Your program must use a function which takes a parameter for the value to be cubed and returns the result by value. The function may not print anything or read anything directly from the user (i.e. no cin/cout in the function). Hint: n cubed is defined as n*n*n. Upload as cubeValue.cpp.

Respuesta :

Answer:

Explanation:

#include <iostream>

using namespace std;

double cube(double);

int main()

{

   double ci=0;

   cout << "Enter avalue :";

   cin >> ci;

   cout << "Cube of " << ci << "is =" << cube(ci) << endl;

   return 0;

}

double cube(double i)

{

   return(i*i*i);

}

ACCESS MORE