πŸ“Š JAVA
Q. What will be the output of the following Java program?
Code:
class Output 
{
    public static void main(String args[]) 
    {    
         int a = 1;
         int b = 2;
         int c;
         int d;
         c = ++b;
         d = a++;
         c++;
         b++;
         ++a;
         System.out.println(a + " " + b + " " + c);
    } 
}
  • (A) 3 2 4
  • (B) 2
  • (C) 2 3 4
  • (D) 3 4 4
πŸ’¬ Discuss
βœ… Correct Answer: (D) 3 4 4

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
68
Total Visits
πŸ“½οΈ
11 mo ago
Published
πŸŽ–οΈ
Vikash Gupta
Publisher
πŸ“ˆ
97%
Success Rate