Programming Shortcut

Write, Run and execute Your programs with simple and esay way by Programming Shortcut

Tuesday, October 10, 2017

Arithmetic Operation in Java Programming

Hello friends! Welcome to my website
How to make a java programming for basic arithmetic operation by the simple method?
This java language programming is free all type of errors like compiler and runtime errors and this programming is tested to compile and then run the programming code. only programming and noting
Here is only programming code only with the there output.

How to make basic arithmetic operation by simple method in java programming

//---- Code Start ----
   import java.util.Scanner;

   public class simplearithmetic {

       public static void main(String[] args) {

         //declaration of the variables and their types
           int a, b, add, sub, multi, reminder, divistion;
          //input
           Scanner c = new Scanner(System.in);
           System.out.print("Enter the frist number: ");
           a = c.nextInt();
           System.out.print("Enter The second number: ");
           b = c.nextInt();
          //opration logic
           add = a + b;
           sub = a - b;
           multi = a * b;
           divistion = a / b;
           reminder = a % b;
         //output of the progrmming code
           System.out.println("Airthmatic basic Oprtaion results:");
           System.out.println(a + " + " + b + " = " + add);
           System.out.println(a + " - " + b + " = " + sub);
           System.out.println(a + " * " + b + " = " + multi);
           System.out.println(a + " / " + b + " = " + divistion);
           System.out.println(a + " % " + b + " = " + reminder);
       }
   }
//----code end-----


Output:    Enter the first number:8
                Enter the second number:4
                Arithmetic basic Operation result:
               8 + 4 = 12
                8 - 4 = 4
                8 * 4 = 32
                8 / 4 = 2
               8 % 4 = 0

Note: Output of the Java programming depends on the input that entered by the Programmer

I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any dought about this java programming code or input & output please comment below
If you have other question about java programming send an email by contacting us form are given on page right side.
Thank You!
Newer Post Older Post Home
");

Programming Shortcut is collections in java best programs with example, best c programs with example and best c++ programs with example, best way to learn java, c and c++

About Programming Shortcut

This is a programming learning website that can help you learn and when your write your programming code. And all programming code is compiled run programming code in the following programming language C, c++, Java, php and Javascript Languages. find your programming read, understand the programming then copy and past and run your program and save your golden time to typing the program becuse you learn more in leas time. All Programming is codeing is ease to understand the programming