If a=54,b=34,c=43 then find the output of this JAVA statement.
int d;
d=a>b?(a>c?a:c):(b>c?b:c);
System.out.print(d);
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Here is a pseudo code of ternary opertor
If the condition is true, then
VALUE 1
is assigned toVARIABLE
else if the condition is false,VALUE 2
is assigned toVARIABLE
.Note: Python implements ternary operator differently but the concept is same.
Evaluating the given expression using the above logic, we find the answer as 54.