Computer Programming Exit Exam Questions (1)
Computer Programming Exit Exam Questions (1)
Remember
a) A coding language
b) A set of instructions to solve a problem
c) A hardware component
d) A debugging tool
✅ Answer: b) A set of instructions to solve a problem
6. Which of the following control statements is used to terminate a loop immediately and transfer control to the s
loop? Understand
a) continue
b) switch
c) break
d) return
✅ Answer: c) break
7. Given the expression x = (a > b) ? a : b;, what kind of operation is being performed, and what
does it achieve? Analyze
a) It assigns a to x unconditionally
b) It compares a and b and assigns the smaller value to x
c) It compares a and b and assigns the greater value to x using a ternary operator
d) It swaps the values of a and b
✅ Answer: c) It compares a and b and assigns the greater value to x using a ternary operator
9. You are asked to design a simple program that calculates the average of three numbers. Which
of the following steps shows correct logical thinking? Create