Since 1 operand in << operator is of long long type, and the answer should be stored as long long,
I am a little surprised by this behavior can anyone explain why this happens?
For Example:
#include<bits/stdc++.h>
using namespace std;
int main(){
long long p=33;
long long a = 1<<p;
cout<<a;
} //This gives the wrong output
int main(){
long long a = 1ll<<33;
cout<<a;
} //this gives right output