Question:

Consider the following statements about C program.
Statement-I: Every program statement must end with a semicolon.
Statement-II: Compiler directives do not end with a semicolon.
The correct answer is

Show Hint

Executable statements usually end with semicolons. Preprocessor directives beginning with # never require semicolons.
Updated On: Jun 25, 2026
  • Both Statement-I and Statement-II are true
  • Both Statement-I and Statement-II are false
  • Statement-I is true, but Statement-II is false
  • Statement-I is false, but Statement-II is true
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

Concept: In C programming, many executable statements end with a semicolon. However, not every line in a C program requires a semicolon. Preprocessor directives are handled before compilation and do not use semicolons.

Step 1:
Examine Statement-I.
Statement-I says: \[ \text{Every program statement must end with a semicolon}. \] This is not true. Examples: \[ if(x>0) \] \[ while(i<10) \] \[ for(i=0;i<10;i++) \] These control statements themselves do not end with a semicolon. Hence Statement-I is false.

Step 2:
Examine Statement-II.
Compiler directives include: \[ \#include \] \[ \#define PI\;3.14 \] These preprocessor directives do not terminate with semicolons. Hence Statement-II is true.

Step 3:
Determine the correct option.
Statement-I is false. Statement-II is true. Therefore, \[ \boxed{\text{Statement-I is false, but Statement-II is true}} \] Hence option (D) is correct.
Was this answer helpful?
0
0