Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. class Swapping
  2. {
  3. public static void main (String[]args)
  4. {
  5. int a=5,b=10,c=15;
  6.  
  7. a=a+b+c;
  8. c=a-b-c;
  9. b=a-b-c;
  10. a=a-b-c;
  11.  
  12. System.out.println("a value:"+a);
  13. System.out.println("b value:"+b);
  14. System.out.println("c value:"+c);
  15. }
  16. }
  17.  
  18. Output:
  19. a value=10
  20. b value=15
  21. c value=5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement