write a c++ program to calculate square and cube of an integer number by using inline function
Answers
Answer:
///program to find the square and cube of the given number
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
///variable declaration
int number,number1;
int result,result1;
///take input from user
cout<<"enter the value of the number:";
cin>>number;
///again take input from user
cout<<"enter the value of the number1:";
cin>>number1;
result = pow(number,2);
cout<<"square of the given number:"<<result;
result1 = pow(number1,3);
cout<<"cube of the given number:"<<result1;
return 0;
}
Explanation:
Answer:
///program to find the square and cube of the given number
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
///variable declaration
int number,number1;
int result,result1;
///take input from user
cout<<"enter the value of the number:";
cin>>number;
///again take input from user
cout<<"enter the value of the number1:";
cin>>number1;
result = pow(number,2);
cout<<"square of the given number:"<<result;
result1 = pow(number1,3);
cout<<"cube of the given number:"<<result1;
return 0;
}
Explanation: