if...else
if...else is a statement. it based on some condition. if the condition can be true the block of if statements can execute other wise the block of else statements can executed.syntax
if([condition])
{
//statements or code;
}
else
{
//statement or code;
}
example,
#include<stdio.h>
#include<conio.h>
main()
int num=1;
{
if(num==1)
{
printf("\n its true");
}
else
{
printf("\n its false");
}
}
Comments
Post a Comment