A

Admin • 833.24K Points
Coach

Q. What is the output of the Java program?

Code:
int horses = 10;
int camels = 5;
if(horses < 5)
{
System.out.println("TOWN");
}
else if(horses >=5)
System.out.print("FOREST ");
System.out.println("AMAZON");
else
System.out.println("UNKNOWN");
  • (A) TOWN
  • (B) FOREST AMAZON
  • (C) UNKNOWN
  • (D) Compiler error
  • Correct Answer - Option(D)
  • Views: 34
  • Filed under category Java
  • Hashtags:

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.

Be the first to start discuss.