- public static void main(String[] args) {
-
- int x, y;
-
- Scanner s=new Scanner(System.in);
-
- System.out.print("enter x value: ");
- x=s.nextInt();
- System.out.print("enter y value: ");
- y=s.nextInt();
-
- if(x==y)
- {
- System.out.print("values are equal");
- }else if(x>y)
- {
- System.out.print("x is greater than y");
- }else
- {
- System.out.print("y is greater than x");
- }
- }
- }
複製代碼 |