In Q 10 of the mentioned quiz, we need to tell the output of this code
void f(){
string s=”abhuhba” ;
bool flag=false;
for(int i=0;i<s.length()/2;i++)
if(s[i]!=s[s.length()-1-i])flag=false;
if(flag)cout<<”YES”;
else cout<<”NO”;
}
Shouldn’t the output be “NO”??
The correct answer shows “YES”.