Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions task 1.2/Comparor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//package tester;

import java.util.Scanner;

public class Comparor{
public static void main(String[] args) {
int x = 0;
int y = 0;
Scanner cin = new Scanner(System.in);

System.out.println("Please enter two numbers to be compared...");
System.out.println("the first number: ");
x = cin.nextInt();
System.out.println("the second number: ");
y = cin.nextInt();

compare_of_two_numbers(x , y);
}

static void compare_of_two_numbers(double num1, double num2){



if(num1 > num2){ System.out.println("the bigger number is: " + num1);}
else if(num1 == num2){System.out.println("both of the number you entered are equal." ) ; }
else{ System.out.println("the bigger number is: " + num2);}

}

}