Arithmetic Operation Examples in Java


Here is the simple program for printing arithmetic operations in Java.

Source Code

/* 
  Tutor Joes Computer Education  
  www.tutorjoes.com

*/ 
import java.io.*;
import java.util.Scanner;
class arthi
{
  public static void main(String args[])
  {
    int a=100,b=2,c;
    c=a+b;
    System.out.println("Add : "+c);
    c=a-b;
    System.out.println("Sub : "+c);
    c=a*b;
    System.out.println("Mul : "+c);
    c=a/b;
    System.out.println("Div : "+c);
    c=123%10;
    System.out.println("Mod : "+c);
  }
}
To download raw file Click Here

Output

Add : 102
Sub : 98
Mul : 200
Div : 50
Mod : 3


Learn All in Tamil © Designed & Developed By Tutor Joes