Not all testcases are passing

#include
#include
using namespace std;

int main(){
char string1[20];
int i, length;
int flag = 0;
cin>>length;
for(int i=0;i<length;i++)
{
cin>>string1;
}

for(i=0;i < length;i++){
    if(string1[i] != string1[length-i-1]){
        flag = 1;
        break;

}
}

if (flag==1) {
    cout << "false" << endl; 
}    
else {
    cout << "true" << endl; 
}
//
system("pause");
return 0;

}

Please save your code on ide.codingblocks.com and then share its link.

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.