Null Statement



A null statement consisting of only a semi colon(;) and performs no operations.

Ex:–

#include<stdio.h>

#include<conio.h>

main()

{
int:;

for(i=1;i<5;i++)

            {

            if(i%2==0)

            ;

            else

            printf(“%d\n”, i);

            }

getch();

}

It can appear when ever a statement expected nothing happens when a null statement is executed. The constructs for, while & do–while must have at least one statement at that time this null statement is used .

Ex:–

for(i=1;i<50;i++);

this is simply causes time delay.

Related

C Language 8960745342273776321

Post a Comment

emo-but-icon

item