Driver program to test above functions
public static void main ( String [ ] args ) { int arr [ ] = { 1 , 10 , 30 , 15 } ; int x = 30 ; int n = arr . length ; System . out . printf ( " % d ▁ is ▁ present ▁ at ▁ index ▁ % d " , x , search ( arr , n , x ) ) ; } }