Friday, 17 July 2015

Write a Java Program to Perform Addition , Subtraction , Multiplication and Division Java Program Material of MCA

Write a Java Program to Perform Addition , Subtraction , Multiplication and Division
class prog5
{   
    public static void main(String args[])
    {   
        int a=10,b=20,add,sub,mul;
        float div,mod;
        add=a+b;
        sub=a-b;
        mul=a*b;
        div=a/b;
        mod=a%b;
        System.out.println("\n Sum:"+add);
        System.out.println("\n Sub:"+sub);
        System.out.println("\n Mul:"+mul);
        System.out.println("\n Div:"+div);
        System.out.println("\n Module:"+mod);
       
    }
}

No comments:

Post a Comment