How to write a java program that add, subtract, multiply, and divide two integer?

1

1 Answers

kalani baduge Profile
kalani baduge answered
You have to use Arithmetic.;

class Arith
{
              public Static void main(String arg[])
                {
                    int x=17, y=5;
                    System.out.println("x="+x);  // x=17
                    System.out.println("y="+y);  // y=5
                    System.out.println("x+y="(x+y));
                    System.out.println("x-y="(x-y));
                    System.out.println("x*y="(x*y));
                    System.out.println"x/y="(x/y));
                  }
}

Answer Question

Anonymous