diff --git a/Searching Algorithms/Linear_Search.cpp b/Searching Algorithms/Linear_Search.cpp new file mode 100644 index 0000000..7c9b031 --- /dev/null +++ b/Searching Algorithms/Linear_Search.cpp @@ -0,0 +1,28 @@ +#include +using namespace std; +int linear_search(int arr[],int key,int size){ + for(int i=0;i>n; + for(int i=0;i>arr[i]; + } + cout<<"Enter the element to search in the array"<>key; + pos= linear_search(arr,key,n); + if(pos==-1){ + cout<<"Element not found"<