Search



Monday, 16 February 2015

If Else

In this program, there will be condition check and if it comes true, the program will move further during execution or terminates itself. The program consist of an integer a whose value if satisfied by "if(a==5)" then "printf("\n Value of a is 5");" will execute, and if not then, "printf("\n Value is not 5");", basically, this if not condition is fulfilled by "else".

Program for If Else concept.

#include<stdio.h>
#include<conio.h>
void main()
{ int a;
clrscr();
printf("\n program to explain concept of if else");
printf("\n\n enter value of a : ");
scanf("%d",&a);
if(a==5)
{ printf("\n value of a is 5");
}
else printf("\n value of a is not 5");
getch();
}



No comments:

Post a Comment

Guys if you think something is wrong or should be edit than please do comment.