+1  A: 

No, 40 is quite right...

What you seem to be expecting is this: "x * 2 * n", but left shift is a different operation.

You can think of left shift as an efficient "x * 2^n" where n is the number - in your case 3. So what you're doing is 5 * 8, which is 40.

Same goes for 80: 5 * 16, which is 80.

Tim Čas
Thank you.I thought Left Shift e1<<e2 is equal to e1*2*e2..Thats y I was not getting my result.
Brite Roy
@Brite: If you think an answer was helpful, you are encouraged to accept it. You might want to read the [FAQ](http://stackoverflow.com/faq).
sbi
+4  A: 

00000101 = 4 + 1 = 5

00101000 = 32 + 8 = 40

Left shift is not successive multiplication by 2, 4, 6, 8 (i.e. x*2)—it's successive multiplication by 2, 4, 8, 16 (i.e. x^2).

John Calsbeek