|
#include <stdio.h>
#include <conio.h>
void main()
{
int m,k,c;
m=2;
for (k=0;k<=10;k++){
c = power(m,k);
printf("%d ^ %d=%d\n",m,k,c) ;
}
}
power(x,y)
int x,y;
{
return((y== 0) ? 1: x* power(x,y-1));
}
위 코딩을 컴파일하면
Compiling TEST.CPP:
Error TEST.CPP 12: Function 'power' should have a prototype
Warning TEST.CPP 19: Style of function definition is now obsolete
와 같이 에러가 나옵니다.
어떻게 수정해야 하는지 알려주세요
|