Dr. A.P.J. Abdul Kalam Technical University (AKTU), Lucknow

Lab Exercise

24. Write a program to search an element in an array using Linear Search.

Sample Input and Output

Stdin Inputs:

27 46 92 42 80 58 13 22 73 38 80

Sample Result:

Input 1 element: 27
Input 2 element: 46
Input 3 element: 92
Input 4 element: 42
Input 5 element: 80
Input 6 element: 58
Input 7 element: 13
Input 8 element: 22
Input 9 element: 73
Input 10 element: 38

Input key: 80
80 is found in array at 5 position.

Leave a Reply

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

Scroll to Top