Which one of the control structures is similar to the if-else statement?

Ngọc Trâm

New member
Which one of the control structures is similar to the if-else statement?
A. Switch-case
B. For loop
C. While loop
D. Continue
 
Answer: A
Explanation: The switch case is another type of decision-making control structure which can be used as a total replacement for the if-else structure. However, since it’s a more rigid structure, it’s mostly used for menu driven programs.
 

Tìm kiếm

Back
Top