diff --git a/ArithmeticOperations.java b/ArithmeticOperations.java new file mode 100644 index 0000000..1cf0665 --- /dev/null +++ b/ArithmeticOperations.java @@ -0,0 +1,25 @@ +// Program to print the sum (addition), multiply, subtract, divide and remainder of two numbers. + +import java.util.Scanner; + +public class ArithmeticOperations { + public static void main(String [] args) { + Scanner in = new Scanner(System.in); + + System.out.print("Input 1st number: "); + int num1 = in.nextInt(); + + System.out.print("Input 2nd number: "); + int num2 = in.nextInt(); + + System.out.println("Addition of two numbers: " + num1 + " + " + num2 + " = " + (num1 + num2)); + + System.out.println("subtraction of two numbers: " +num1 + " - " + num2 + " = " + (num1 - num2)); + + System.out.println("Multiplication of two numbers: "+ num1 + " x " + num2 + " = " + (num1 * num2)); + + System.out.println("Division of two numbers: " + num1 + " / " + num2 + " = " + (num1 / num2)); + + System.out.println("Remainder of two numbers: "+ num1 + " mod " + num2 + " = " + (num1 % num2)); + } +} \ No newline at end of file diff --git a/README.MD b/README.MD index 5054464..2fa785f 100644 --- a/README.MD +++ b/README.MD @@ -1,6 +1,6 @@ # JAVA Programs For Everybody To Try! -_`Last Updated: April 25' 2021`_ +_`Last Updated: April 26' 2021`_ ## Introduction: @@ -38,6 +38,7 @@ if the problem still persist then create a issue or use Google/Stack Overlflow f |12 | [RootsOfQuadracticEquationStatic.java](https://github.com/psavarmattas/Java-Projects/blob/master/RootsOfQuadraticEquationStatic.java) | Program to find the root of quadratic equation (Static Method). | |13 | [RootsOfQuadracticEquation.java](https://github.com/psavarmattas/Java-Projects/blob/master/RootsOfQuadraticEquation.java) | Program to find the root of quadratic equation (Dynamic Method). | |14 | [Calculator](https://github.com/psavarmattas/Java-Projects/blob/master/Calculator.java) | Program that implements the arithmetic operation (Calculator) using switch statement. +|15 | [ArithmeticOperations.java](https://github.com/psavarmattas/Java-Projects/blob/master/ArithmeticOperations.java) | Program to print the sum (addition), multiply, subtract, divide and remainder of two numbers | @@ -53,6 +54,7 @@ if the problem still persist then create a issue or use Google/Stack Overlflow f |1 | [FibonacciSeriesStatic.java](https://github.com/psavarmattas/Java-Projects/blob/master/FibonacciSeriesStatic.java) | Program to generate fibonacci series upto n value (Static Method). | |1 | [RootsOfQuadracticEquationStatic.java](https://github.com/psavarmattas/Java-Projects/blob/master/RootsOfQuadraticEquationStatic.javav) | Program to find the root of quadratic equation (Static Method). | |2 | [EvenOddDynamic.java](https://github.com/psavarmattas/Java-Projects/blob/master/EvenOddDynamic.java) | Program to find out the number entered is Even/Odd (Dynamic Method). | +|2 | [ArithmeticOperations.java](https://github.com/psavarmattas/Java-Projects/blob/master/ArithmeticOperations.java) | Program to print the sum (addition), multiply, subtract, divide and remainder of two numbers | |2 | [LargestNumber.java](https://github.com/psavarmattas/Java-Projects/blob/master/LargestNumber.java) | Program to find out the largest number (Dynamic Method). | |2 | [PrimeOrNot.java](https://github.com/psavarmattas/Java-Projects/blob/master/PrimeOrNot.java) | Program to find out the prime or not (Dynamic Method). | |2 | [PrimeNo.java](https://github.com/psavarmattas/Java-Projects/blob/master/PrimeNo.java) | Program to display first n Prime number (Dynamic Method). |