Questions
Questions

Introduction To Object Oriented Programming (082025-CMM)

Single choice

What is the output of the following code? int i = 2; int j = 4; while (i < j) { i++; j--; } MessageBox.Show(i.ToString());

Options
A.a. 3
B.b. 5
C.c. 4
D.d. Error
Question Image
View Explanation

View Explanation

Verified Answer
Please login to view
Step-by-Step Analysis
We start with i = 2 and j = 4. The loop condition is while (i < j). Option a. 3 - In the first (and only) iteration, i is incremented to 3 and j is decremented to 3. After this iteration, the loop condition (i < j) becomes (3 < 3), whic......Login to view full explanation

Log in for full answers

We've collected over 50,000 authentic exam questions and detailed explanations from around the globe. Log in now and get instant access to the answers!

More Practical Tools for Students Powered by AI Study Helper

Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!