Write a Program to find largest value using ternary operator in C

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,max;

printf("\n\n Enter any two values: ");
scanf("%d%d",&a,&b);

max=(a>b)?a:b;

printf("\n\n Largest Number is %d",max);

getch();

}

Previous
Next Post »