text
stringlengths 0
312
|
---|
num = 45 |
print("Tangent", math.tan(num)) |
# Write a program to print bit wise AND of two numbers |
a = 60 # 60 = 0011 1100 |
b = 13 # 13 = 0000 1101 |
c = a & b # 12 = 0000 1100 |
print("AND", c) |
# Write a program to print bit wise OR of two numbers |
a = 60 |
b = 13 |
c = a | b |
print("OR", c) |
# Write a program to print bit wise XOR of two numbers |
a = 60 |
b = 13 |
c = a ^ b |
print("XOR", c) |
# Write a program to calculate Binary Ones Complement of a number |
a = 60 |
c = ~a |
print("Binary Ones Complement", c) |
# write a program to Binary Left Shift a number |
c = a << 2 |
print("Binary Left Shift", c) |
# write a program to Binary Right Shift a number |
c = a >> 2 |
print("Binary Right Shift", c) |