Is poalindrome?

there is a segmentation fault here is the code:

@vketan182 hey you can’t take integer to string like this . your approach is wrong. see the approach below:

** Initialise flag to unset  **int flag = 0** .*
** Loop the array till size n/2*
** In a loop check if  **arr[i]! = arr[n-i-1]**  then set the  **flag = 1**  and  **break***
** After the loop has ended, If flag is set the print  **“Not Palindrome”**  else print  **“Palindrome”***

@vketan182 i have corrected your code . you can see the below link

would’nt that string would have itreated for n/2

@vketan182 yes you are right. But we are getting integer input from test cases . To use string we have to first convert integer to String. Then You can do whatever you want.

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.