Suppose you were given an integer number in decimal notation. This when represented in binary will be a series of 0's and 1's. This sequence varies in length with the magnitude of the number. Now suppose you wanted to flip the 'n'th position bit in this sequence of binary numbers, how would you do it?
The result of the program must be the number represented by the sequence with the bit in the 'n'th position flipped.
Edit: This is not a homework question! An intern asked me this question! And all I could do was fumble! So could someone give me a helping hand here! All I can think of is assembly level stuff right now (put it in a register and blah, blah)! But is there a way to do it in C? I have been out of school for quite some time now! Trust me, my only homework nowadays is probably tax returns! :-D