pow

Overview :

The "pow" function is used for calculation of x to the power of y i.e.x^y;

Syntax :
double pow(double x,double y);
Description :

The "pow" function accepts 2 parameters

  • x -> The x is base number

  • y -> The y is exponent number

"pow" function return the value of x^y.

Example :
#include <stdio.h>
#include <math.h>
#include<conio.h>

 int main()
 {
	double ans,x,y;
	clrscr();
	printf("\nEnter the value of base : ");
	scanf("%lf",&x);

	printf("\nEnter the value of exponent : ");
	scanf("%lf",&y);

	ans = pow(x,y);

    printf("%.2lf to the power %.2lf is %.2lf", x,y,ans);
    getch();
	return 0;

 }

Comments

comments powered by Disqus