What is Left shift ?
Basically,shifting are possible on binary bits.
Example-
Number is: 8
Its binary is 1000
Then one Left shift is 10000(i.e, 16 in decimal)
program:
#include< iostream>
int main() {
int n,a;
cout<<"Enter number"<< endl;
cin>>n;
a=n<< 1;
cout<<"One Left shift is "<< a;
a=n<< 2;
cout<<"Two Left shift is "<< a;
a=n<< 3;
cout<<"Three Left shift is "<< a;
}
Enter number
3
One Left shift is 6
Two Left shift is 12
Three Left shift is 24