CompTIA ITF+ (FC0-U61) — Question 285
A programmer is creating a program that makes a decision based on user input and has decided to use a branching statement. Which of the following commands would be BEST for the programmer to use?
Answer options
- A. IF THEN
- B. WHILE
- C. FOR
- D. BEGIN
Correct answer: A
Explanation
The IF THEN command is the most appropriate choice for implementing branching logic, as it allows the program to make decisions based on specified conditions. The WHILE and FOR commands are used for looping, which does not fit the requirement for decision-making, while BEGIN is not a command that facilitates branching.