Q. What is the output of the code snippet with the ternary operator?
Code:
int p=5;
System.out.print("Hello ");
(p<6)?5:6;
β
Correct Answer: (D)
Compiler error
int p=5;
System.out.print("Hello ");
(p<6)?5:6;
You must be Logged in to update hint/solution