Write a program to check Nth bit is set or not, if yes, clear the Mth bit

Description:

    • Read a number, M and N from the user. You need to check whether N th bit is set(1) or not, If yes, then you need to clear the M th bit of the number and print the updated value of num

Pre-requisites:

    • Bitwise operators

Sample Execution:

Test Case 1:

Enter the number: 19

Enter ‘N’: 1

Enter ‘M’: 4

Updated value of num is 3 

Test Case 2:

Enter the number: 19

Enter ‘N’: 2

Enter ‘M’: 4

Updated value of num is 19