Driver Code
int main ( ) { char ar [ ] = { ' e ' , ' g ' , ' t ' , ' y ' } ; int n = sizeof ( ar ) / sizeof ( ar [ 0 ] ) ; char K = ' u ' ; char ch = bs ( ar , n , K ) ; if ( ch == ' @ ' ) cout << " - 1" ; else cout << ch ; return 0 ; }