Array linear search

#include
using namespace std;
int main() {
int N;
cin>>N;

if(N>0){
	int a[N];
for(int i=0;i<N;i++){
	cin>>a[N];
}
int M;
cin>>M;
	for(int i=0;i<N;i++){
		if(a[i]==M){
			cout<<i<<endl;
			break;
		}
	}
}
return 0;

}

plz tell whats wrong in code

hi @sahilkumar23102003_bbf6ee38349d98a1
corrected code -->

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.