Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

Need an Explanation for the code.

$
0
0

I wrote a code like this

#include<iostream>
using namespace std;
int main()
{ 
int w=32;
int x=1<<w;
int z=1<<32;
cout<<"X : "<<x<<endl; //Case 1
cout<<"Z : "<<z<<endl; //Case 2
return 0;
}

On running output is X : 1 and Z : 0 Please help me how answer is different in the two cases.


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>