Check if a number has two adjacent set bits | C # program to check if there are two adjacent set bits . ; Driver code
using System ; class GFG { static bool adjacentSet ( int n ) { int x = ( n & ( n >> 1 ) ) ; if ( x > 0 ) return true ; else return false ; } public static void Main ( ) { int n = 3 ; if ( adjacentSet ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }