hi:
I want to compare values in the 3 element array and see if they are equal, if equal display message. The code compiled but result not expect. Can someone help
RESULT: equalCode:#include <iostream> #include <cstdlib> using namespace std; int main() { int a[3]={1,2,3}; for(int i=0; i<3; i++) { if(a[i] ==a[i++]) cout<<"equal"<<endl; else cout<<"not equal"<<endl; }//end loop system("pause"); return 0; }//end main
thank you