Skip to content

A simple java program that runs 3 tasks, to compare two numbers, check if a certain number is positive, negative or zero and an add/subtract program

License

Notifications You must be signed in to change notification settings

ramy2m/JavaCompareCheckPositivityAndCalculate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Java Compare, Check Positivity and Simple Calculator

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.

Problems

  1. Compare Two Numbers

    • Input: Two integers
    • Output: Which one is greater, or if they are equal
  2. Check Positivity

    • Input: One integer
    • Output: Whether the number is positive, negative, or zero
  3. Simple Calculator

    • Input: Two integers and an operator (+ or -)
    • Output: The result of the calculation

How to Run

  1. Install Java (JDK 17 or later recommended).
  2. Compile the program:
    javac Main.java

About

A simple java program that runs 3 tasks, to compare two numbers, check if a certain number is positive, negative or zero and an add/subtract program

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages