1. 程式人生 > >Day6.17 C語言簡單函式遞迴呼叫之求x的y次方

Day6.17 C語言簡單函式遞迴呼叫之求x的y次方

#include<stdio.h>
int xy(int x,int y){
int jieg;
if(y==1){
jieg=x;
}else{
jieg=xy(x,y-1)*x; 
}
return jieg;
}
int main(){
int jieg;
jieg=xy(2,3);
printf("jieg=%d\n",jieg);
system("PAUSE");
 return 0;
  }