This repository contains 3 small Java problems solved in a single program (Main.java
).
The program uses Scanner
to take input from the user and prints the result for each problem.
-
Compare Two Numbers
- Input: Two integers
- Output: Which one is greater, or if they are equal
-
Check Positivity
- Input: One integer
- Output: Whether the number is positive, negative, or zero
-
Simple Calculator
- Input: Two integers and an operator (+ or -)
- Output: The result of the calculation
- Install Java (JDK 17 or later recommended).
- Compile the program:
javac Main.java