Linear search in C

C program to perform linear search in an array of numbers. It prints the location of the element in the array if the searched element is present in the array, else prints its absence.

Program: Search an element in an array

Output: Search using linear search

Enter the number of elements in array: 6
Enter 6 integer(s): 43 75 56 97 83 65 
Enter the number to search: 56
56 is present at location 3.




Enter the number of elements in array: 6
Enter 6 integer(s): 43 75 56 97 83 65
Enter the number to search: 17
17 is not present in the array.

Share your code in the comments for linear search in an array in C.

Share this code with your programmer friends.

Follow us on twitter.

About ᴾᴿᴼᵍʳᵃᵐᵐᵉʳ

Linux and Python enthusiast, in love with open source since 2014, Writer at programming-articles.com, India.

View all posts by ᴾᴿᴼᵍʳᵃᵐᵐᵉʳ →

Leave a Reply

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