πŸ“Š JAVA
Q. What would be the output of the following code snippet if variable a=10?
Code:
if(a<=0)
{
   if(a==0)
   {
     System.out.println("1 ");
   }
   else 
   { 
      System.out.println("2 ");
   }
}
System.out.println("3 ");
  • (A) 1 2
  • (B) 2 3
  • (C) 1 3
  • (D) 3
πŸ’¬ Discuss
βœ… Correct Answer: (D) 3

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
223
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Ritu Singhal
Publisher
πŸ“ˆ
97%
Success Rate