Simple IF in C

The simple is statement is powerful decision making statement and is used to control the flow of execution of statement.the syntax of simple is is.

Syntax


if(expression)		
{
	statement-block;
}					
							

Example

the example of simple if condition that check you have enterd number is zero or not.


#include<stdio.h>
#include<conio.h>

void mian()
{
	int a;
	
	printf("Enter Any Number:");
	scanf("%d",&a);
	
	if(a==0)
	{
		printf("Yes!..You Have Enter Zero")
	}
}								
							

the example is simple if condition that execute only if part in condition.user can enter any number ,if check this number is zero or not and display output on screen.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!