A

Admin • 830.13K Points
Coach

Q. What is the output of this program?

Code:
public class ternary_operator_Example
{
public static void main(String args[])
{
int a = 5;
int b = ~ a;
int c;
c = a > b ? a : b;
System.out.print(c);
}
}
  • (A) 6
  • (B) 4
  • (C) 3
  • (D) 5
  • Correct Answer - Option(D)
  • Views: 23
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.