C # program to check if k - th bit of a given number is set or not .
using System ; class GFG { public static void isKthBitSet ( int n , int k ) { if ( ( n & ( 1 << ( k - 1 ) ) ) > 0 ) Console . Write ( " SET " ) ; else Console . Write ( " NOT ▁ SET " ) ; }