PROGRAM TO SHOW THE USE OF CONDITIONAL OPERATOR

/*PROGRAM TO SHOW THE USE OF CONDITIONAL OPERATOR*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf(“Enter any two numbers to check which of them is greater: “);
scanf(“%d%d”,&a,&b);
c=(a>b)?a:b;          //ILLUSTRATING USE OF CONDITIONAL OPERATOR
printf(“%d is greater”,c);
getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *