Friday, 9 May 2014

IF ELSE STATEMENT IN C PROGRAM

IF ELSE STATEMENT IN C PROGRAM

#include<stdio.h>       //header file stdio.h
#include<conio.h>       //header file conio.h
main()                                     //main function
{                                          //start of the program
int a,b;                               //variable declaration
clrscr();  //clrscr function is used to clear the previous output screen
printf("enter the values of a and b ");
scanf("%d%d",&a,&b);
if(a==b)       //if block works only on condittion is true
{
printf("the values of a and b is equal");
}
else       // if condition fails else block run
{
printf("the values of a and b is not equal");
}
getch();
}//end of the program

No comments:

Post a Comment