Answer to Question #255523 in Java | JSP | JSF for Tege

Question #255523

Write the java program that calculates maximum of the given two numbers.


1
Expert's answer
2021-10-24T05:54:37-0400




import java.util.*;


public class App {
	public static void main(String[] args) {
		Scanner keyBoard = new Scanner(System.in);
		System.out.print("Enter two numbers: ");
		int number1 = keyBoard.nextInt();
		int number2 = keyBoard.nextInt();
		if (number1 > number2) {
			System.out.println("Number1 > Number2");
		}else if (number1 > number2) { 
			System.out.println("Number1 < Number2");
		}else {
			System.out.println("Number1 = Number2");
		}
		


		keyBoard.close();


	}


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS