Question Detail

COS 102 2 lecture week 3 Objective Question

Question

What is the primary function of an 'if...else' statement in programming, according to the document's table of statements?
Options
A To get input from the user.
B To create a loop that runs a specified number of times.
C To make a decision.
Correct Answer
D To output a message to the user.
Correct Answer

Option C is the correct answer.

Detailed Explanation

Slide 22, in the table under 'Statement' and 'Purpose', lists 'if...else' with the purpose 'A decision'.

Hint

This statement is fundamental for conditional logic in programming.

Question Info