Q. What is the output of the below Java program?

Code:
int a=1;
while(a<4)
{
  System.out.print(a + " ");
  a++;
}
  • (A) 1 2 3 4
  • (B) 1 2 3
  • (C) 6
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 1 2 3

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
376
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
93%
Success Rate