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.

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs