Array linear search question

#include
using namespace std;

int main() {

int n;
cin>>n;
int a[n];
for(int i=0 ; i<n ; ++i){
cin>>a[i];
}
int m;
cin>>m;
for(int i=0 ; i<n ;++i){
if(m=a[i]){
cout<<i;
}
}
return 0;

}
//what is the reason im getting all the indices as the answer

hi @srivastavaayush1611_3fd51b257da0b834 updated https://ide.codingblocks.com/s/664339

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.