Friday, July 8, 2011

Find Powers of Given no. in C++ using FUNCTION



#include<stdio.h>
#include<conio.h>
#include<math.h>
double function_power(double,double);
int main()
{
     double base,power,ans;
     printf("enter base:");
     scanf("%lf",&base);
     printf("enter power:");
     scanf("%lf",&power);
     ans=function_power(base,power);
     printf("answer->%lf",ans);
     getch();
     return 0;
}
double function_power(double base,double power)
{
    double temp;
    temp=pow(base,power);
    return temp;
}



No comments: