Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

PALINDROME

AIM:
To find whether the given string is a palindrome or not?
ALGORITHM:
1.
2.
3.
4.
5.
6.
7.
8.
9.

Start the program.


Accept a string `s1 from the user.
Calculate the length (k) of string`s.
Initialize looping counters i=0,j=(len-1).
Repeat the steps 6to7 while i<k.
If s2[j]=s1[i] go to step 7 else go to step 8
Set s2[len]=`\0
I=i+1 j=j-1
Compare the two strings(s2,s1) and If equal go to step 9 else go
to step 10
10.Print the given string is not a palindrome go to step 11
11.Print the given string is not a palindromego to step11
12.Stop the program

You might also like