Type in the following main routine exactly as shown and add the
definitions of two
functions, cubeit0 and cubeit1, each that provides the cube of the
argument x. You
may not use the pow() math library function.
#include <iostream>
//Function cubeit0 goes here
//Function cubeit1 goes here
int main(void)
{ cout << "Input a number to be cubed: ";
double x;
cin >> x;
cout << cubeit0(x) << endl;
double result;
cubeit1(x,result);
cout << result << endl;
return 0;
}
Here is an example of how the program is intended to work:
% a.out
Input a number to be cubed: 3
27
27
%
Type in the following main routine exactly as shown and add the definitions of two functions, cubeit0 and cubeit1, each
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Type in the following main routine exactly as shown and add the definitions of two functions, cubeit0 and cubeit1, each
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!