How do you write a program to find out largest number between two numbers using ternary operators?

1 answer

Answer

1282910

2026-07-17 19:50

+ Follow

// assume you want the find the largest of ints a,b,c:

int max = (a>b&&a>c?a:b>c?b:c);

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.