Declarations and Initializations – Find Output of Program

11. In the following program how long will the for loop get executed?

Screenshot 4

A. The for loop would not get executed at all
B. The for loop would get executed only once
C. The for loop would get executed 5 times
D. The for loop would get executed infinite times

Correct Answer: D. The for loop would get executed infinite times

12. What will be the output of the program?

Screenshot 5

A. 40 40
B. 20 40
C. 20
D. Error

Correct Answer: B. 20 40

Leave A Comment?

2 × 3 =