C LAB‎ > ‎(Sem1) Introduction to C‎ > ‎

WAP to check which of the two entered numbers is greater.

posted Nov 18, 2010, 4:40 AM by Neil Mathew   [ updated Nov 18, 2010, 4:44 AM ]


SOURCE CODE:

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
 
main ()
{
 
int a,b,c;
printf("\n Enter two Numbers: ");
scanf("%d%d",&a,&b);
 
c=a ? b:a ;
printf("\n Greater number of the two is : %d \n",c);
}
 

 

 

OUTPUT:

 

 Enter two Numbers: 5 357
 Greater number of the two is : 357 

 


Comments