CPP program to find k - th bit from right
#include <bits/stdc++.h> NEW_LINE using namespace std ; void printKthBit ( unsigned int n , unsigned int k ) { cout << ( ( n & ( 1 << ( k - 1 ) ) ) >> ( k - 1 ) ) ; }