top of page
APCSAaday.com
public static void main(String[] args)
{
int x = 5;
int y = 10;
int z = 15;
if (x > y && x > z)
{
System.out.println("X is the greatest");
}
else if (y > x && y > z)
{
System.out.println("Y is the greatest");
}
else if (z > x && z > y) {
System.out.println("Z is the greatest");
}
else
{
System.out.println("There is a tie");
}
}
What will this method return?
A) X is the greatest
B) Y is the greatest
C) Z is the greatest
D) There is a tie
What is the correct answer, don't forget to check out the video explanation
A
B
C
D
Don't hesitate to email apcsaproblemaday@gmail.com if you're still stuck with any questions.
Related Posts
Comments
Share Your ThoughtsBe the first to write a comment.
bottom of page