top of page

August 29, 2024

Aug 28

1 min read

0

2

0

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


video explanation

Don't hesitate to email apcsaproblemaday@gmail.com if you're still stuck with any questions.

Aug 28

1 min read

0

2

0

Comments

Share Your ThoughtsBe the first to write a comment.
bottom of page