Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Program to perform Linear Search

Program to perform Linear Search

August 20, 2012 Comments Off on Program to perform Linear Search By admin

Linear Search:

Linear search involves searching the element from a given set of elements beginning from the first element upto the last element or upto its first occurrence if it is available in the given set.  The efficiency of Linear Search is O(n).  The program to perform linear search is given below:

/* Linear Search */
#include <stdio.h>

#define MAX 10

int main(){
int arr[MAX],n,i,num,val;
printf(“nEnter total numbers?”);
printf(“nEnter number?”);
printf(“nEnter the value to search?”);
printf(“nNumber found.”);
printf(“nNumber not found.”);

Comments are closed
x Close

Like Us On Facebook

You cannot copy content of this page.