Your Ad Here

Friday 6 January 2012

Write a Program to explain the concept of Arithmetic Operators in java


class arithemetic
{
            public static void main(String args[])
            {
                        float a=12, b=2;
                        System.out.println("a= " +a);
                        System.out.println("b= " +b);
                        System.out.println("a+b= " +(a+b));
                        System.out.println("a-b= " +(a-b));
                        System.out.println("a*b= " +(a*b));
                        System.out.println("a/b= " +(a/b));
                        System.out.println("a%b= " +(a%b));
            }
}

No comments:

Post a Comment