Header Ads Widget

if Statement

This statement is used to test a condition. If the condition is true then statements written inside if block are executed. In  C, any non zero value is considered as true while a zero is considered as false.

if( condition)
{
    statement;
     ............
}

Example :
#include<stdio.h>
void main()
{
int i;
scanf("%d",&i);
if(i)
  {
    printf(" A non zero value ");
  }
}


Post a Comment

0 Comments