text: Bitwise OR of Bitwise AND of all subarrays of an array | C # program for the above approach ; Function to find the Bitwise OR of Bitwise AND of all consecutive subsets of the array ; Stores the required result ; Traverse the given array ; Print the result ; Driver Code
code: using System ; class GFG { static void findbitwiseOR ( int [ ] a , int n ) { int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) res = res | a [ i ] ; Console . Write ( res ) ; } public static void Main ( ) { int [ ] A = { 1 , 2 , 3 } ; int N = A . Length ; findbitwiseOR ( A , N ) ; } }