Computer programs to print ternary operator
Answers
Answered by
1
#include<stdio.h>
#include<conio.h>
void main()
{
int x = 5, y = 10;
printf("Max of %d and %d is: %d\n", x, y, (x>y? x: y));
getch();
}
OUTPUT:
Max of 5 and 10 is: 10
#include<conio.h>
void main()
{
int x = 5, y = 10;
printf("Max of %d and %d is: %d\n", x, y, (x>y? x: y));
getch();
}
OUTPUT:
Max of 5 and 10 is: 10
Similar questions