#include
using namespace std;
int linear(int a[],int N,int M)
{
int i;
for( i=0; i<N; i++)
{
if(a[i]==M)
{
return i;
break;
}
}
if(i==N)
{
return-1;
}
}
int main() {
int N ,M ,a[10],i,ans;
cin>>N;
for(i=0; i<N; i++)
{
cin>>a[i];
}
cin>>M;
ans=linear(a,N,M);
cout<<ans;
return 0;
}
What is the mistake error is coming
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
please tell again where was my mistake
hi @abhishekpandeybhu_da87a9e0d2c73079, please send the code link by saving in ide.codingblocks.com
login
write
save (ctrl + s)
send the url of the page then