Answer to Question #237743 in C++ for scada HMI

Question #237743

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.


1
Expert's answer
2021-09-15T23:39:29-0400


#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS