Find the greatest among three integer. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Find the greatest among three integer.

3rd Jul 2016, 6:04 AM
MANOJ KUMAR BERA
MANOJ KUMAR BERA - avatar
2 Answers
+ 3
use max () built in function 2 times..to reduce code
3rd Jul 2016, 7:55 AM
αѕнωιи мσнαи
αѕнωιи мσнαи - avatar
0
public class Program { public static void main(String[] args) { int x=5, y=9, z=12, big; if (x>y&&x>z) { big=x; } else if(y>x&&y>z){ big=y; } else { big=z; } System.out.println(big); } }
3rd Jul 2016, 6:04 AM
MANOJ KUMAR BERA
MANOJ KUMAR BERA - avatar