이렇게 2개 에러나는데 고쳐주세요
statement missing
function should return a value
#include<stdio.h>
float power(float, int);
void main(void)
{
float a;
int b;
printf("(x)^n 에서 x값과 n값을 입력하시오:\n");
scanf("%f",&a);
scanf("%d",&b);
printf("%f^%d=%f이다.",a,b,power(a,b));
}
float power(float a,int b)
{
float ans=1;
int i;
for (i=1; i<b; ++i)
ans*=a
return ans;
}
}
|