Skip to content

Write a program that checks if a string entered by the user is a palindrome. A palindrome is a word that reads the same forwards as backwards like “racecar" or "hannah".

License

Notifications You must be signed in to change notification settings

CodingChallengesBooklet/Palindromes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Palindrones

In this code challenge we check if a string entered by the user is a palindrome.

GitHub followers Twitter Follow
GitHub language count GitHub code size in bytes GitHub issues GitHub last commit GitHub branch checks state

Problem

Write a program that checks if a string entered by the user is a palindrome. A palindrome is a word that reads the same forwards as backwards like “racecar" or "hannah".

Solution

A palindrome program is one of the easiest programs to write! In some programming languages reversing text is done in different ways, so in the code below we simply reverse it using the REVERSE keywords.

First, we get the user input, and then reverse the text and store the result in a new variable reversed_text.

text = INPUT
reversed_text = REVERSE text

After that, we check if the text entered is the same as the reversed text.

IF text = reversed_text THEN
    OUTPUT "The text you entered is a palindrome!"
ELSE 
    OTUPUT "The text you entered is NOT a palindrome!"

About

Write a program that checks if a string entered by the user is a palindrome. A palindrome is a word that reads the same forwards as backwards like “racecar" or "hannah".

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Languages