Computer Science, asked by sharvandu, 5 months ago

Write a program in Java to swap two numbers without using third variable

Using scanner class ​

Answers

Answered by sainiinswag
2

Answer:

The answer is in attachment.

.

...

.

.

Plzzz Follow me ...

.

Plzzzzz Thanks and like my Answer...

Attachments:
Answered by nilamkumari91229
0

Answer:

Swap two numbers without using third variable in java

class demo {

public static void main(string arg[]) {

System.out.println("Before swapping");

int x = 10;

int y = 20;

System.out.println("value of x:" + x);

System.out.println("value of y:" + y);

system.out.println("After swapping");

Similar questions