skip to main
|
skip to sidebar
Less Than 3
Friday, October 3, 2008
Programming: Swapping Variables
Here's a pretty simple programming problem:
Let A equal some integer and B equal some different integer. How can you swap these variables without using a temporary variable?
1 comment:
Peter Nguyen
October 4, 2008 at 6:28 PM
a = a+b
b = a-b
a = a-b
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Heart
Less than 3 could be referred to as math or a heart. In this case, I heart math and riddles. ( ;;^_^)/ -- <3
Blog Archive
►
2009
(1)
►
March
(1)
▼
2008
(19)
▼
October
(6)
Pocket Change
Missing $1
Programming: Swapping Variables
The Monty Hall Problem
Children
Measuring
►
September
(7)
►
August
(6)
About Me
NeroNguyen
View my complete profile
My Other Blog(s)
Booz without Booze
a = a+b
ReplyDeleteb = a-b
a = a-b