πŸ“Š JAVA
Q. What will be the output of the following Java code?
Code:
class ternary_operator 
{
    public static void main(String args[]) 
    {        
         int x = 3;
         int y = ~ x;
         int z;
         z = x > y ? x : y;
         System.out.print(z);
    } 
}
  • (A) 0
  • (B) Break halts the execution and forces the control out of the loop
  • (C) 3
  • (D) -4
πŸ’¬ Discuss
βœ… Correct Answer: (C) 3

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
115
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Vijay Sangwan
Publisher
πŸ“ˆ
89%
Success Rate