fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int func(){
  5. static int x = 0;
  6. const int a = 2;
  7. return (int)pow(a, x++);
  8. }
  9.  
  10. int main(void) {
  11. int i;
  12. for(i=0; i<5; i++){
  13. printf("%d\n", func());
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5544KB
stdin
Standard input is empty
stdout
1
2
4
8
16