Ruby program to demonstrate the bitwise left-shift (<<) operator

bookmark

num1=4
num2=3
res =0

res = num1 << num2;

print num1," << ", num2," = ",res

 


Output:

4 << 3 = 32