Linear Search is also known as sequential search.
Here the array of integers are entered in the array ‘arr’.
Variable ‘x’ is used to store the element to be search.
Then a funtion ‘linear_search()’ is called which keep on comparing each element of array with the element to search until the desired element is found or list ends.
If element is found then funtion returns its position to the main function otherwise it returns ‘-1′ indicating element not found.