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 <stdio.h>
#include <conio.h>
#include <math.h>

int main()
{
    float a,b;
    double p,sr;
    printf("Enter 2 integer numbers\n");
    scanf("%f%f",&a,&b);
    p=pow(a,b);
    sr=sqrt(p);
    printf("Square root of power %f = %lf",p,sr);
    return 0;
}

Output

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