Linear search in C

In this tutorial, we will see about linear search in C.
Linear search also known as sequential search, is used to find element in array sequentially. You will search target element one by one in the array until either you get the element or you reached to the end of the array.

Here is simple program for linear search in C.

Output:

Enter number of elements in the array:4
Enter array elements:
10
30
20
90

Enter element to search:30
Element found at index 1

That’s all about linear search in C.

Leave a Reply

Your email address will not be published. Required fields are marked *