Dremendo Tag Line

Input 2 integers and print the square root of the power of the numbers using mathematical functions in C++

Mathematical Functions - Question 6

In this question, we will see how to input 2 integer numbers and print the square root of the power of the numbers ab in C++ programming using the mathematical functions. To know more about mathematical functions click on the mathematical functions lesson.

Q6) Write a program in C++ to input 2 integer numbers and print the square root of the power of the numbers ab.

Program

#include <iostream>
#include <conio.h>
#include <cmath>

using namespace std;

int main()
{
    float a,b;
    double p,sr;
    cout<<"Enter 2 integer numbers\n";
    cin>>a>>b;
    p=pow(a,b);
    sr=sqrt(p);
    cout<<"Square root of power "<<p<<" = "<<sr;
    return 0;
}

Output

Enter 2 integer numbers
3
2
Square root of power 9 = 3
video-poster