Computer Science, asked by omkarpasi2162, 8 months ago

Write a Java program to change the contents of two memory locations

Answers

Answered by sneha9719
0

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