JP Assignment 2&3
JP Assignment 2&3
Assignment: 2 & 3
Date: 7 April, 2025 Time: 50 mins
55. Which keyword is used to compare a 59. The do-while loop evaluates the
single variable with multiple values? condition:
a) if a) Before the loop starts
b) else b) At the beginning of each iteration
c) switch c) At the end of each iteration
d) compare d) Only once
56. What type of loop is a while loop? 60. What will the following code output?
a) Entry controlled
b) Exit controlled int i = 0;
while(i < 3) {
c) Conditional System.out.print(i);
d) Counter controlled i++;
}
57. Which loop is guaranteed to execute at
least once? a) 0 1 2
a) while b) 1 2 3
b) do-while c) 0 1 2 3
c) for d) Infinite loop
d) None