Skip to main content
ratans6128
May 26, 2023
Solved

check palindrome

  • May 26, 2023
  • 7 replies
  • 1 view

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

    Best answer by sanchitg0002

    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

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

    May 26, 2023

    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
    June 23, 2023

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

    June 23, 2023

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

    harshitb6843
    May 26, 2023

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

    mikes0011
    Brainy
    May 26, 2023

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

    The Expression Guru