Skip to main content
Added main() assuming no addtional argc's
Source Link
Brian
  • 1.1k
  • 12
  • 18

The task never specified that the program must terminate after 1000.

void f(int n){ printf("%d\n",n); f(n+1); } int main(){ f(1); } 

(Can be shortened to this if you run ./a.out with no extra params)

void main(int n) { printf("%d\n", n); main(n+1); } 

The task never specified that the program must terminate after 1000.

void f(int n){ printf("%d\n",n); f(n+1); } int main(){ f(1); } 

The task never specified that the program must terminate after 1000.

void f(int n){ printf("%d\n",n); f(n+1); } int main(){ f(1); } 

(Can be shortened to this if you run ./a.out with no extra params)

void main(int n) { printf("%d\n", n); main(n+1); } 
Source Link
Brian
  • 1.1k
  • 12
  • 18

The task never specified that the program must terminate after 1000.

void f(int n){ printf("%d\n",n); f(n+1); } int main(){ f(1); } 
Post Made Community Wiki