text: C # code to linearly search x in arr [ ] . If x is present then return its location , otherwise return - 1
code: using System ; class GFG { public static int search ( int [ ] arr , int x ) { int n = arr . Length ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == x ) return i ; } return - 1 ; }