>Not a good way
I can't really imagine a "good" way to answer this make-work question. Every possible solution is ridiculous and impractical compared to just using the addition operator. :icon_rolleyes:

Upon reflection I can not but wonder: Where does this trend of inquiring for obsolete techniques come from?
Pursuit of such skills are as irrelevant to a programmer as it would be for an aspirant mountaineer to learn how to make ropes out of camel's hair.

To future inquires, searching for the same topic, the following counsel is profitable:
Learn the basics, and learn them well; if you need to ask such a question, the basics you know not yet.

>If you plan to get lost, rope can be obtain readily available
Because intelligent people don't leave their houses without a good length of rope...just in case. :icon_rolleyes:

p.s. It's not a bad idea to carry around a flint and multi-tool though.

Even when the only connection I thought between getting lost, Sahara mountains, and my metaphor, was Sahara, desert; camels don't mind desert, perhaps primordial skills of survivor; I celebrated the humor intended and as such I went to the ridiculous extreme.
What's your excuse?
Regardless, I digressed.
Given the comment that Mr. Dave Sinkula made, which opinion I value, and now yours, Narue,
I have to conclude that my message was not understood as intended in its entirety.
Therefore, I beg the opportunity to make it clearer without metaphors, this time.
My exhortation in essence was this: Before looking for the knowledge of exotic tricks, and cleverness such:

How to print "Hello world!" without using a semicolon?
How to swap two numbers without using temporary variable?
How to add two numbers without using arithmetic operators?
How to find whether a given number is even or odd without using % (modulus) operator?
How to find whether the given number is a power of 2 in single step (without using loops)?
How to find greatest of two/three/four numbers without using relational operators?
How to print 1 to n without using any kind of loops or recursion?
Etc...

An aspirant programmer would benefit more of learning the basics, than rather pursuing the answer to unusable tricks ( for the most part ). Especially, when a comprehension of the basics will eventually lead to the answer to those questions.

I wasn't endorsing a ban to the understanding of how a computer works at the lowest level, nor at any level.

My exhortation in essence was this: Before looking for the knowledge of exotic tricks, and cleverness such:

How to print "Hello world!" without using a semicolon?
How to swap two numbers without using temporary variable?
How to add two numbers without using arithmetic operators?
How to find whether a given number is even or odd without using % (modulus) operator?
How to find whether the given number is a power of 2 in single step (without using loops)?
How to find greatest of two/three/four numbers without using relational operators?
How to print 1 to n without using any kind of loops or recursion?
Etc...

An aspirant programmer would benefit more of learning the basics, than rather pursuing the answer to unusable tricks ( for the most part ). Especially, when a comprehension of the basics will eventually lead to the answer to those questions.

Although I myself had a similar reaction to this type of homework when I first encountered it, I later recognized it as something a bit different from the usual silly trickery. One of the last times I encountered it was here. There is a bit of similarity with K&R exercises.

The 32-bit assumption may be dealt with separately, but the problem set from which these problem comes from I found ranged from simple to challenging. In essence, it imparted a greater familiarity with the binary operators. I found this to be a measure of good to walk away with, whatever the original intent of these exercises.

I realize the OP did not quite elaborate to clarify my assumption, so perhaps I just read in a little more than was necessary.