Microsoft interview question

“Write a one-line C expression to determine if a number is a power of 2”. Microsoft is famous for asking such questions to their programmers. Or you might want to find out what the assembly code

CWD
XOR AX, DX
SUB AX, DX

does. Satish’s site has the answer, but not the question. More questions: 1 2