题目
题目

Introduction To Object Oriented Programming (082025-CMM)

单项选择题

Consider the following code : int i = 0; while (i < 5) { MessageBox.Show(i.ToString()); i++; } Which of the following is correct?

选项
A.a. The loop will only run once
B.b. The loop will run indefinitely
C.c. The loop will display numbers 1 to 5
D.d. The loop will display numbers 0 to 4
题目图片
查看解析

查看解析

标准答案
Please login to view
思路分析
To analyze what the loop does, I’ll step through how the code executes on each iteration. First, the variable i is initialized to 0. The while condition checks i < 5 before each iteration, so the loop will run as long as i is less than 5. Inside the loop, the current value of i is shown via MessageBox.Show(i.ToSt......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!