posted 18 years ago
Hello, AnuragSudha!
First of all, I think you wrote wrong your code.
This must have been your intention:
The result is: 11111111111111111111111111100110;
Now, here is the explination:
i = -13, its represantation: 11111111111111111111111111110011
i << 1, means add 1 zero starting with the lowest bit:
11111111111111111111111111100110 (= -26).
By the way, x<<n means x*2^n (x mutiplied with 2 at the power n).
In this case -13<<1 = -13*2^1 = -13*2 = -26.