Why this code run infinite time?? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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(); }

14th Nov 2019, 3:45 AM
Preity
Preity - avatar
1 ответ
+ 5
Because you call display() and display calls main() and it loops forever, its that simple.
14th Nov 2019, 3:54 AM
Avinesh
Avinesh - avatar