DEV Community

Raja B
Raja B

Posted on

Questions & Answer

1.Question1

(Since the if condition is false, "hello" is skipped; and because there are no curly braces {}, "bye" runs normally as an independent line.)

2.Question 2

(Since the if condition is true, this line runs "hello" ; and because there are no curly braces {}, "bye" runs normally as an independent line.)

3.Question 3

Since i stays 5 and never changes, the condition i >= 1 is always true, causing an infinite loop that prints "hello" forever without reaching "bye"

4.Question3-1

This use for infinite loop but methods overflow next line Bye not excute output but not space

Top comments (0)