Answer:
The answer to this question is given below in the explanation section. It is noted that this program is written in C++ using online C++ compiler.
Explanation:
#include <iostream>
using namespace std;
int squared(int num)// this is the function to compute square
{
return num*num;
}
int cube(int num)// this is the function to compute cube
{
return num*num*num;
}
int main()
{
int user_num, user_num2; // variable declaration
cout<<"Enter the first number: ";//prompt user to enter the number
cin>>user_num;//store the user entered number into variable
cout<<"\nEnter the second number: ";//prompt the user to enter the second number
cin>>user_num2;//store the user entered number into variable
cout<<"\nSquared of first number is: "<<squared(user_num);//compute square of user_num and display
cout<<"\nCube of first number is: "<<cube(user_num);//compute the cube of the user_num and display
cout<<"\nSquare of second number is: "<<squared(user_num2);//compute the square of user_num2 and display
cout<<"\nCube of second number is: "<<cube(user_num2);//compute the cube of user_num2 and display
cout<<"\nSum of number 1 and number 2 is: "<<user_num2 + user_num2;//display the sum of user_num2 and user_num
cout<<"\nProduct of number 1 and number 2 is: "<<user_num2 * user_num;//display the product of user_num and user_num2
return 0;//terminate the program
}