题目
题目

COMP1117_1A_2025 Quiz

单项选择题

What is the purpose of the following code snippet?

选项
A.A. Error
B.B. None of the others
C.C. if a > b, print the three numbers a, b, c in ascending order
D.D. if a > b, print the three numbers a, b, c in descending order
题目图片
查看解析

查看解析

标准答案
Please login to view
思路分析
We start by examining what the code snippet does when a > b, since the question asks about the purpose of the given branch. Option A: Error. This is unlikely because the nested if-else structure is syntactically valid and logically consistent for comparing a, b, and c. The code is designed to choose an ordering based on comparisons; there’s no immediate syntax o......Login to view full explanation

登录即可查看完整答案

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

类似问题

更多留学生实用工具

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