0

Java program to check maximum no between thtee numbers

import java. util. Scanner; class GreaterThree { public static void main(String args[ ]) { int x, y, z; System. out. println("Enter three numbers :") ; Scanner obj=new Scanner (System.in) ; x=obj.nextInt( ) ; y=obj.nextInt( ) ; z=obj.nextInt( ) ; if(x>y && x>z) System.out.println(" x is greater") ; else if(y>x && y>z) System.out.println(" y is greater") ; else if(z>x && z>y) System.out.println(" z is greater") ; else System.out.println(" Entered no are not distinct") ; } }

21st Jun 2019, 5:17 AM
Av Avinash Singh Rathore
Av Avinash Singh Rathore - avatar
2 odpowiedzi
+ 6
Some syntax errors here : import java.util.Scanner; //U in small class //C in small System.out.println() //O & P in small int x,y,z; //I in small also, you can show value of greater number
21st Jun 2019, 5:19 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
0
❓❓t
21st Jun 2019, 5:20 AM
Av Avinash Singh Rathore
Av Avinash Singh Rathore - avatar