(i) Write a function that returns the cube of the integer passed to it. For example cube(2) will
return 8 and
cube(3) will return 27.
#include <iostream> #include <iomanip> using namespace std; long long cube(int num) { return num*num*num; } int main() { int num; cout<<"Num:"; cin>>num; cout<<cube(num)<<endl; return 0; }
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments