Originally posted by amit goel:
it will implicitly do the widening conversion .and will change it to long type .
i am not able to get what do you mean by (99%32=3).please explain.
Amit,
'%' is the modulus operator(ie.remainder).If the LHS operand is an int and the RHS operand is larger than 32(size of int)then,the LHS operand is shifted by (RHS operand %32).Similarly,when the LHS operand is a long and the RHS operand is larger than 64(size of long) then,the LHS operand is shifted by (RHS operand % 64).
For instance,the expression 1<<34 would be evaluated as 1<<2(34%32=2 ie. 34 divided by 32 leaves a remainder of 2).