pow() function in C language are used to find the power of any number.
-It is define in math.h heador file.
Syntax-
pow(a,b);
// it will return the a to the power b.
Example-
pow(2,1) will return 2
pow(2,4) will return 16
pow(2,5) will return 32
pow(2,10) will return 1024
pow(5,0) will return 1
pow(2,0) will return 1
pow(1,1000) will return 1
program-
#include < stdio.h>
#include< math.h>
int main()
{
int a,b,c;
printf("Enter first number\n");
scanf("%d",&a);
printf("Enter second number\n");
scanf("%d",&b);
c=pow(a,b);
printf("%d to the power %d is %d",a,b,c);
}
Enter first number
2
Enter second number
4
2 to the power 4 is 16