```
main()
{
int i=0xff;
printf("\n%d",i<<2);
}
```

please tell me how to work out this code...

and what will be the output...

Featured Replies

- 3
Sorry Adak, I have to say that your answer is completely wrong. The hexadecimal number 0xff stands for its decimal equivalent f*16 + f = 15*16 + 15 = 255. Therefore, the decimal value of 0xff is 255! The numerical operator << does left shift. Each left shift by one … Read More

- 1
What you also need to be aware of is that right shift of a signed value in C is a platform defined operation and may be either arithmetic shift or logical shift. That means the the operation [code]-2 >> 1[/code] is not truely portable because the result could be either … Read More

This topic has been dead for over six months. Start a new discussion instead.

Recommended Topics