educative.io

Educative

The 4th question, the answer should be infinite loop

The answer to the fourth question should be “2. infinite loop” as the for loop in the main function has no way to break out.

Hi @Raghavendra_Nataraj,

This is Maham Amjad from Educative. I noticed your feedback here, and I’m glad you reached out to us.

Thank you for bringing up the attention to this point. Actually, the correct answer is D. Because options B and C both are true. The console will print the values and we’ll also face the timeout running program error because of the infinite loop. Thank you for reaching out! Please feel free to reach out if you have any other queries or concerns.

Best Regards,
Maham Amjad| Technical Content Engineer
Educative Inc.

Thank you .