Computer Science, asked by utkarshapatil, 1 year ago

write a c++ program to calculate square and cube of an integer number by using inline function​

Answers

Answered by Rajkumarpatel89
5

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:

Answered by samerasudeesh216
3

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:

Similar questions