why answer for this is 8 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

why answer for this is 8

#include <stdio.h> void main() { int x = 1, z = 3; int y = x << 3; printf(" %d\n", y); }

21st Apr 2019, 9:05 AM
Saurabh Pandit
Saurabh Pandit - avatar
1 Answer
+ 19
The current value of x is 1. And after applying left shift by 3, the value becomes 8 as it is shifted by 3 bits as 1 << 3 will be 8 https://www.sololearn.com/learn/4087/?ref=app
21st Apr 2019, 9:11 AM
Nova
Nova - avatar