Skip to content

Instantly share code, notes, and snippets.

@raviyasas
Created April 25, 2020 20:13
Show Gist options
  • Save raviyasas/e752acf0cb10eb8394f9cfb79581d577 to your computer and use it in GitHub Desktop.
Save raviyasas/e752acf0cb10eb8394f9cfb79581d577 to your computer and use it in GitHub Desktop.
Swap Number
package com.app.interviews;
public class SwapNumber {
public static void main(String args[]) {
int x = 10;
int y = 20;
x = x + y;
y = x - y;
x = x - y;
System.out.println(x);
System.out.println(y);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment