有关函数的问题
下面的函数错在哪里呢?请大家帮我看看吧main()
{int n;double x,result,power();
printf ("please input X and N:\n");
scanf ("%f%d",&x,&n);
if (n<0) printf ("no!");
else {result=power(x,n);printf ("result=%lf\n",result);}
getch();}
double power(a,b)
double a;int b;
{double p;
if (b>0) for (p=1;b>0;b--) p*=a;return (p);}