Pages

Thursday, March 27, 2014

C Program to demonstrate use of pow() function to find power

/*to find power*/
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
    float x,y, pw;
    printf("enter base: ");
    scanf("%f",&x);
    printf("enter index: ");
    scanf("%f",&y);
    pw=pow(x,y);
    printf("%f to the power %f is %f",x,y,pw);
    system ("pause");
    return 0;
}

No comments:

Post a Comment