Q10 of string quiz

The flag is not assigned to true. How can “YES” be the output?

hi @nikhil.gupta.225

Instead of initializing flag with false, it should be bool flag = true;
This program checks whether a string is palindrome or not. So we check till length/2 and match string characters from first and last. If we encounter any non matching character then we set flag to false and break from the loop.

Hope it Helps.