Which of the following is a control statement in C?
19 views
- int x;
- x = 5;
- if (x > 0) { printf("x is positive"); } (Correct Answer)
- printf("x = %d", x);
Explanation
Correct answer: c) if (x > 0) { printf("x is positive"); }
Explanation: A control statement in C is a statement that controls the flow of a program. The if statement is a control statement that allows a program to execute a block of code if a certain condition is true.