Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion linear-search.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@ void display()
{
// display code goes here
}
int linearSearch()
int linearSearch(int A[],int n)
{
// linear search code goes here
for(int i=0;i<9;i++){
if(n==A[i])
printf("ooh yess!!");


}

}
int main()
{
int arr[] = {5, 3, 7, 9, 10, 12, 7, 2, 4};
// main program
int x;
scanf("%d",&x);
linearSearch(arr,x);

return 0;
}