Computer Science, asked by yuvraj7thgen, 6 months ago

Write a Java program to interchange two values without using the third variable.

[Note: Read the values using parameterized input method]

Answers

Answered by Anonymous
2

Explanation:

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