Search an Element in an Array in C

Search an Element in an Array

In this example code, you will learn to Search an Element in an Array in C programming. Follow the following steps to complete the program:-

Step 1 Create an array list by input some numbers.

Step 2 Input a number to find location.

Step 3 Start a loop and check every element with search number.

Step 4 If search number matched with array element, store location in location variable.

Step 5 Print the number, and value of location variable.

Program to Search an Element in an Array in C

Output

Enter 5 Numbers  : 3 6 2 9 1

Enter the element to search in the array :2

2 found at location of 3

 

 

Check out our other C programming Examples

 

 

 

Leave a Comment

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

Scroll to Top