Strings-is pallindrome

The logic i try to use is that i take up a string a and then store the reverse of it in b and compare both are equal but for some cases only it passes so i print both the strings to check and i found string b is taking garbage value at end so why it is happening and how to correct it


Here is the code

@abhibansal252 you are taking the size as 100 but it the quesiton it can be upto 1000
correct the size and it will work fine
if your dout still exists let me know and if clear mark it as resolved and rate my experience

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.

Hi Abhishek
just make the size of character array as 1000 or just take it input as a string https://ide.codingblocks.com/s/617559

Hi @abhibansal252
is ur doubt resolved??

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.