C Programming Tutorial
Computer Tutorial

The if Design Control Statement



The if Statement

The if statement is execute if the condition inside the statement is true. If the condition is not true then the statement is not executed; instead the program skips past it.
The condition following the keyword if is always enclosed within a pair of parentheses ( { ...... } ).

The general form of if statement is

if ( condition / expression  )
{
Statements to be executed ;
.
.
.
}

C Program to show the use of if statement

\* C Program to show the use of if statement *\
# include < stdio.h >
int   main( )
{

int   num  ;
printf(" Enter any number : ") ;
scanf("%d ", & num) ;
if ( num > 10  )
{

printf("\n Entered number is greater than 10. ") ;

}
return ( 0 );

}