Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Swapping
- {
- public static void main (String[]args)
- {
- int a=5,b=10,c=15;
- a=a+b+c;
- c=a-b-c;
- b=a-b-c;
- a=a-b-c;
- System.out.println("a value:"+a);
- System.out.println("b value:"+b);
- System.out.println("c value:"+c);
- }
- }
- Output:
- a value=10
- b value=15
- c value=5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement