If Else In C Programming

Posted on

If Else

 

If Else

 

On the whole it may be used to execute one block of assertion amongst two blocks, in C language if and else are the key phrase in C.

if else statement - If Else In C Programming

Syntax

if(situation){........statements........}else{........statements........}

Within the above syntax each time situation is true all of the if block assertion are executed remaining assertion of this system neglecting. If the situation is fake then else block assertion will executed and neglecting if block statements.

Instance

#embrace#embracevoid most important(){int time=10;clrscr();if(time>12){printf("Good morning");}else{printf("Good after midday");}getch();}

Output

Good morning