Set the K | Java implementation to set the kth bit of the given number ; function to set the kth bit ; kth bit of n is being set by this operation ; Driver code
class GFG { static int setKthBit ( int n , int k ) { return ( ( 1 << k ) n ) ; } public static void main ( String arg [ ] ) { int n = 10 , k = 2 ; System . out . print ( " Kth ▁ bit ▁ set ▁ number ▁ = ▁ " + setKthBit ( n , k ) ) ; } }