Advertisement
Vankata17

SWAP NUMS

Oct 23rd, 2019
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class asdasd{
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  int a = 10;
  7.  int b = 20;
  8. System.out.println("a="+a+"      b="+b);
  9. int temp = a;
  10. a=b;
  11. b=temp;
  12. System.out.println("a="+a +"      b="+b);
  13.  
  14.        
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement