Perform arithmetic operations with the help of third variable in java

Write a java program to perform arithmetic operations with the help of third variable.

public class kan
{
        public static void main(String args[])
        {
           int a=10,b=20;
           int c,d,e;
           float f;
           System.out.println("Value of a is"+a);
           System.out.println("Value of b is"+b);
           c=a+b;
         
           System.out.println("Addition of two number is"+c);
           d=a-b;
           System.out.println("Subtraction of two number is"+d);
           e=a*b;
           System.out.println("Multiplication of two number is"+e);
           f=a/b;
           System.out.println("Division of two number is"+f);
        }
}

Leave a Reply

Your email address will not be published. Required fields are marked *