CCCPaste

Linear Search program

// 1) WAP to implement linear search
#include 
using namespace std;

int main(){
    
    cout<<"Enter the size of the array: ";
    int n;
    cin>>n;
    int arr[n];
    cout<<"Enter the array elements: ";
    for(int i=0;i>arr[i];
    }

    cout<<"Enter the element to be searched: ";
    int element;
    cin>>element;
    int index=-1;
    for(int i=0;i