Write an algorithm to check an array is a mirror array.
Anónimo
int main() { int flag=-1; int ar[5]={4,1,5,1,4}; for(int forword=0,bw=4;forword=0;forword++,bw--){ if(ar[forword]==ar[bw]){flag=1;} else{flag=-1;break;} //for(int bw=4;bw>=0;bw--) } flag==1?printf("ok"):printf("not ok"); }