Computer Science, asked by jaintina082, 4 days ago

predict the output of :


import java.util.Scanner;
public class Swap
{ public static void main(String args[]) { Scanner in = new Scanner(System.in); System.out.print("Enter first number: ");int a = in.nextInt();
System.out.print("Enter second number: ");int b = in.nextInt();
a= a+b;
b= a-b;
a= a-b;
System.out.println("The value of a= " + a); System.out.println("The value of b= " + b); } }​

Answers

Answered by vidhyabarud
2

Suppose,

a = 2

b = 5

OUTPUT

Enter first number : 2

Enter second number : 3

The value of a = 5

The value of b = 2

Similar questions