fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int i;
  6. double n, d;
  7.  
  8. printf("N=\n");
  9. scanf("%lf", &n);
  10. d = 1;
  11. for (i = 1; i <= 10; i++) {
  12. d *= n;
  13. printf("N^%d=%g\n", i, d);
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 1680KB
stdin
3
stdout
N=
N^1=3
N^2=9
N^3=27
N^4=81
N^5=243
N^6=729
N^7=2187
N^8=6561
N^9=19683
N^10=59049