text: Driver code
code: public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 3 , 3 , 3 , 10 } ; int n = arr . Length ; int x = 3 ; if ( isMajority ( arr , n , x ) == true ) Console . Write ( x + " ▁ appears ▁ more ▁ than ▁ " + n / 2 + " ▁ times ▁ in ▁ arr [ ] " ) ; else Console . Write ( x + " ▁ does ▁ not ▁ appear ▁ more ▁ than ▁ " + n / 2 + " ▁ times ▁ in ▁ arr [ ] " ) ; } }