if-statement
Sometimes we require executing one or more statements based on some condition. In such situation we can use if- statement.
Syntax- of if-block
if ( condition )
{
Statements (s); // one or more statements
}
Here, a condition is specified with if. If the condition is TRUE then statement(s) inside if-block will be executed. If the condition is FALSE, then statement(s) inside if-block will be skipped.
Flowchart-

Example-
#include < stdio.h >
#include < conio.h >
void main ( )
{
// Variable Declaration
float pa, dis, na;
clrscr ( );
// Input
printf ( “ \n Enter the Purchase Amount \n “ );
scanf ( “ %f “, &pa );
// Processing
dis = 0;
if ( pa > = 1000 )
{
dis = pa * 0.1;
}
na = pa – dis ;
// Output
printf ( “ \n Discount = %f “, dis );
printf ( “ \n Net Amount = %f “, na );
getch ( );
}