Write a function to calculate the Cube × Cube of a number C. Your function should take an
integer pointer to C. Display the original value of C and its Cube × Cube cube in the main
function.
#include <iostream>
using namespace std;
int func(int &n){
int cube=n*n*n;
return cube;
}
int main()
{
int C;
cout<<"\nEnter a number: ";
cin>>C;
int Cube=func(C);
cout<<"\nC= "<<C;
cout<<"\nCube*Cube= "<<Cube*Cube;
return 0;
}
Comments
Leave a comment