In: Computer Science
1) type a complete, working, C++ program that accepts two integer values from the variable num3, and store num1 raised to the power num2 into the variable num4. Then output the values of the four variables each on a separate line, formatted and with an appropriate message for each.keyboard into the variables num1 and num2, include prompts, store the square root of their sum into the
program :
CPP program :
//header files
#include <iostream>
#include<cmath>
using namespace std;
//main() method
int main()
{
//declaring variables
int num1=0,num2=0;
float num3=0,num4=0;
//asking user num1
cout<<"Enter num1 : ";
cin>>num1;//reading num1
//asking user num2
cout<<"Enter num2 : ";
cin>>num2;//reading num2
//calculate square root of their sum
num3=sqrt(num1+num2);
//calculate and num1 raised to power of num3
num4=pow(num1,num2);
//print numbers
cout<<"num1 : "<<num1<<endl;//print num1
cout<<"num2 : "<<num2<<endl;//print num2
cout<<"The square root of their sum :
"<<num3<<endl;
cout<<"num1 raised to the power num2 :
"<<num4<<endl;
return 0;
}
=============================================
Output :