Skip to main content
ratans6128
New Participant
May 26, 2023 5:59 AM UTC
Solved

check palindrome

write a program to check whether it is a palindrome or not ?

Input : 12321

output : it is a palindrome

input : mam

output : it is a palindrome

input : 12345

output: not a palindrome

    sanchitg0002
    Inspiring
    May 26, 2023 6:21 AM UTC

    Atleast give it a try before posting here.

    a!localVariables(
      local!input: char(code(ri!input)),
      local!reverse: reverse(local!input),
      and(local!reverse = local!input)
    )

    7 replies

    stefanhelzle0001
    Brainy
    May 26, 2023 6:11 AM UTC

    Another one ... really !?!?! What did your try so far?

    sanchitg0002
    Inspiring
    May 26, 2023 6:21 AM UTC

    Atleast give it a try before posting here.

    a!localVariables(
      local!input: char(code(ri!input)),
      local!reverse: reverse(local!input),
      and(local!reverse = local!input)
    )

    amitk9244
    Participating Frequently
    Jun 23, 2023 10:29 AM UTC

    I tried this logic, its not working for number like 121, 1331. 

    sanchitg0002
    Inspiring
    Jun 23, 2023 12:29 PM UTC

    Then try it again. It still works perfectly for any palindrome.

    harshitb6843
    Brainy
    May 26, 2023 6:43 AM UTC

    Use this - https://chat.openai.com/
    Would save your and our time. 

    mikes0011
    Brainy
    May 26, 2023 2:55 PM UTC

    sigh, i've been avoiding trying this thing out, but...

    The Expression Guru