Well First off you might want to use another subject line like
"Im having problems using my pow function"
also code tags help. they are [ code] [ /code]
here is a quick fix that I can come up with
Code:
#include <stdio.h>
#include <math.h>
int main(void)
{
double x = 0, y =0;
printf("Enter x:");
fflush(stdout);
x = atoi(getch());
printf("Enter y:");
fflush(stdout);
y = atoi(getch());
printf("x^y = %f",pow(x,y);
return 0;
}
You are trying to use inline functions..
I just looked over you code closer and you forgot to close your for loop..
Here is the fix to your code
Code:
#include <stdio.h>
double pow(double , double );
int main()
{
double x, y, count, power;
for (count=1; count<=15; ++count)
{
printf("enter the number you would like to use\n", x);
scanf("%lf", &x);
printf("enter the power the number is placed to\n", y);
scanf("%lf", &y);
power = pow( x , y);
printf("the answer is %5.3lf\n", power);
}
return 0;
}
double pow(double x, double y)
{
double power= x*y;
return(power);
}
:edit:
Blast Dog beat me to it while I was writing my reply.
If you want to learn C I would recomend that you get the K&R