Home / Programming MCQs / JAVA MCQs / Question

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

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.