This program is a simple Python script that demonstrates the use of shift operators in Python.
Here's a step-by-step explanation of what the code does:
Note that in this code, the shift operator is being used to shift the bits of the number to the right or left by 1 position, but it can be used to shift by any number of positions.
number =int(input("Enter Number : ")) print("Shift Operator Example ") print("Right Shift ",number,">>1"," Result = ",number>>1) print("Left Shift ",number,"<<1"," Result = ",number<<1)To download raw file Click Here
Enter Number : 5 Shift Operator Example Right Shift 5 >>1 Result = 2 Left Shift 5 <<1 Result = 10
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions