0

Why this code run infinite time??

#include <stdio.h> int main() { printf("Learn C\n"); display(); return 0; } void display(){ printf("followed by C++ and Java\n"); main(); }

11/14/2019 3:45:46 AM

Preity

2 Answers

New Answer

+5

Because you call display() and display calls main() and it loops forever, its that simple.

+3

It doesn't just loop forever it continuously calls one function after another until it blows the stack!