Program to clear K | C ++ program to clear K - th bit of a number N ; Function to clear the kth bit of n ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int clearBit ( int n , int k ) { return ( n & ( ~ ( 1 << ( k - 1 ) ) ) ) ; } int main ( ) { int n = 5 , k = 1 ; cout << clearBit ( n , k ) << endl ; return 0 ; }