Computer Science, asked by madhu9272, 11 months ago

write a program to print maximum of given three numbers using conditional operator?​

Answers

Answered by renuagrawal393
5

Answer:

Biggest Of Three Numbers Using Conditional operator/Ternary Operator in C

# include <stdio.h>

void main()

{

int a, b, c, big ;

printf("Enter three numbers : ") ;

scanf("%d %d %d", &a, &b, &c) ;

big = a > b ? ( a > c ? a : c) : (b > c ? b : c) ;

printf("\nThe biggest number is : %d", big) ;

hope it helps you.....

mark it in brainliest answer

Answered by jk18mehar
0

Answer:

int m,a,c;

m=(a>b && a>c)?  a : (b>a && b>c)?  b : c;

Explanation:

if(a>b && a>c) a is assigned to m,else (b>a && b>c)?.

if(b>a && b>c) then b is assigned to m else c is assigned to m.

The largest of the three integers a,b and c is assigned to m.

Similar questions