void linear(string s[10],int n,string key)
{
for(int i=0;i<n;i++)
{ string s1=s[i];
cout<<s1<<" "<<key;
if(strcmp(key,s[i])==0)
{
cout<<"element found at "<<i+1<<"th index"<<endl;
return;
}
}
cout<<"element not found"<<endl;
return;}
int main()
{ int n;
string key;
string s[10];
cout<<“enter the values of n:”;
cin>>n;
cin.ignore();//if we do not put this line then it would take \n as the imput of first string s[0]
for(int i=0;i<n;i++)
getline(cin,s[i]);
cout<<“enter the key:” ;
getline(cin,key);
linear(s,n,key);
}