+ 1

int c = 8 << 2; printf("%d",c); what will be the output?

Can anyone explain with explanation.

18th Sep 2020, 1:46 AM
Ambika Kewat
4 Answers
+ 4
should be 32. 128 64 32 16 8 4 2 0 start at 8 and move left 2
18th Sep 2020, 1:50 AM
Slick
Slick - avatar
+ 4
c = 8<<2 c = 00001000<<2 =00100000=32 ā¬…ļø ā†”ļø printf("%d",c); //Output: 32 Just an explanation of Slick
18th Sep 2020, 3:23 AM
Jenson Y
+ 3
The << is bitwise operator. I suggest you check this. https://www.sololearn.com/learn/4087/?ref=app
18th Sep 2020, 2:11 AM
ä½ ēŸ„é“č¦å‰‡ļ¼Œęˆ‘也ę˜Æ
ä½ ēŸ„é“č¦å‰‡ļ¼Œęˆ‘也ę˜Æ - avatar