R

Rajeev Malhotra • 3.97K Points
Extraordinary

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: 91
  • Filed under category JAVA

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.


Question analytics