int array[]={1,2,3,4,5,6};
int occurrence=-1;
int key=4;
for(int i=0;i<6;i++){
if(array[i]=key){
occurrence=i;
}
}
cout<<occurrence;
In this code above,if I use assignment operator instead of "==" in the fifth line there doesn't come any error but it's printing something else i.e 5 what it's representing here??what does that assignment operator signify here