fork download
  1. #include <stdio.h>
  2. int power(int a,int b){
  3. int c = 1;
  4. while(b-->0)
  5. c*=a;
  6. return c;
  7. }
  8. int main(void) {
  9. int x,n,y;
  10. x = 2;
  11. n = 4;
  12. y = power(x,n);
  13. printf("%dの%d乗は%d",x,n,y);
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
2の4乗は16