Write a Java Program for Linear Search on unsorted array

By | January 30, 2017

Write a Java Program for Linear Search on unsorted array


To search any element present inside the array in Java Programming using linear search technique, you have to use only one for loop to check whether the entered number is found in the list or not as shown in the following program.

Following Java program first ask to the user to enter the array size then it will ask to enter the array elements, then it will finally ask to enter a number to be search in the given array to check whether it is present in the array or not, if it is present then the program will show the position of that number present in the array:

 

SOURCE CODE ::

 

 

OUTPUT  ::

 

 

Leave a Reply