fork download
  1. #include<stdio.h>
  2. int powerlog(int a,int b){
  3. if(b==1) return a;
  4. int k = powerlog(a,b/2);
  5. int recAns = k * k;
  6. return recAns;
  7. }
  8. int main(){
  9. int a=2;
  10. int b=4;
  11. int p = powerlog(a,b);
  12. printf("The ans is %d",p);
  13. return 0;
  14. }
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
The ans is 16