Search Your C Program

Tuesday, 24 January 2012

Program to Print the Greater from Two Numbers

#include<stdio.h>
#include<conio.h>
void main()
{
                  int a,b;
                  clrscr();
                  printf("\n Enter two numbers : ");
                  scanf(" %d %d ",&a,&b);
                  if(a>b)
                  printf(" %d  is greater ",a);
                  else
                  printf(" %d  is greater ",b);
                  getch();
}


Note : In this program we use if-else statement. In this if condition is true then if statement block is executed otherwise else statement block is executed .

No comments:

Post a Comment