Test case 0 fail

#include
using namespace std;

int main() {
int n,m;cin>>n;int ar[100];
for(int i=0;i<n;i++){
cin>>ar[i];
}

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




return 0;

}

while compilering ans is correct but only test case 0 fail

Hello @yashtripathi6969_0cd127807d833066,
The condition if(i==n) will be out of the loop. and the constraints are the Range of Numbers can be between -1000000000 to 1000000000. M can be between -1000000000 to 1000000000. as mentioned so int data type can’t handle his range it would be long long int.

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.