Blog Moved

This website completely moved to new domain. For latest content, visit

Search This Blog

6 Aug 2012

C program to find Greatest Of Two Numbers Using Conditional Operator

/* C Program to find Greatest of Two Numbers Using Conditional Operator.. */
 int a,b,c;
 printf("\n Enter two Numbers: ");
 scanf("%d %d",&a,&b);
 c=(a>b)?a:b;  /* (a>b) is true then c=a else c=b */
 printf("\n The Greatest number is : %d",c);

Sample Output: ( using GNU GCC Compiler with Code Blocks IDE )

No comments:

Post a Comment