Friday, July 29, 2016

C Basics - The null Statement in C

A null statement is a statement containing only a semicolon ; it can appear wherever a statement is expected. Nothing happens when a null statement is executed. The syntax of null statement is:

;

Statements such as do, for, if, and while require that an executable statement appear as the statement body. The null statement satisfies the syntax requirement in cases that do not need a statement body.
Example:

for ( i = 0; i < 10; line[i++] = 0 )
     ;



Related topics:
Overview of Statements in C   |   Decision Making Statements in C   |   The if Statement in C   |   The if-else Statement in C   |   The else-if Statement in C   |   Nested if-else Statement in C   |   Forms of if Statement in C   |   Switch Statement in C   |   Conditional Operator Statement in C

List of topics: C Programming

No comments:

Post a Comment