fork download
  1. #include <iostream>
  2. #include<cstdio>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. cout<<(1<<34); // gives output 0
  8.  
  9. int i=1;
  10. i=i<<34;
  11. cout<<i ; //gives 4 as out put , why ?
  12. return 0;
  13. }
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7: warning: left shift count >= width of type
prog.cpp:10: warning: left shift count >= width of type
stdout
00