human
Modify a bit at a given position | Returns modified n ..
Driver code"
Solution in Python:
assistant
#Here is code to modify a bit at a given position and the other steps required.
 def modifyBit ( n , p , b ) :
	mask = 1 << p
	return ( n & ~ mask ) | ( ( b << p ) & mask )
def main ( ) :
	print ( modifyBit ( 6 , 2 , 0 ) )
	print ( modifyBit ( 6 , 5 , 1 ) )
if __name__ == ' _ _ main _ _ ' :
	main ( )