Computer Science, asked by pirates817, 7 months ago

Write A Program In Java Take Two Number In Two Int Variable And Print Addition And Subtraction Of Them

Please answer correctly ​

Answers

Answered by unknowngenius1424
0

Answer:

Explanation:

import java.util.*;

class ADDandSUB

{

 public static void main()

 {

   Scanner sc=new Scanner(System.in);

   int a,b,sum,sub;

   System.out.println("Enter 2 numbers");

   a=sc.nextInt();

   b=sc.nextInt();

   sum=a+b;

   sub=a-b;

   System.out.println("Sum: "+sum+"\n Difference: "+sub);

  }

}

Similar questions