Showing posts with label Swap. Show all posts
Showing posts with label Swap. Show all posts

Wednesday, May 6, 2009

Puzzle 22 - Swap again!

Language – Java/C++ | Type – Problem (Code) | Last date 10-May-2009 12:00 p.m. IST | Points 5

This is one of those classic puzzles …

Write a program that swaps two numbers.
Twist: Do not use a temporary variable while doing the swap.

Think this one is pretty easy? You might want to try out its tougher variation here.

Got an answer? Why don’t you leave it here.

Wednesday, March 4, 2009

Puzzle 4 – The Swap

Language – Java/C++ | Type – Problem (Code) | Last date 8-Mar-2009 12:00 p.m. IST | Points 5

Swapping can be easy, but this is the hardest swap ever!

Write a program that swaps two numbers.
Twist: Do not use “=” (equal sign) in entire program.

(Hard isn't it? )

Got an answer? Why don’t you leave it here.