Write a program to check a string whether it is palindrome or not.
Answers
Answered by
1
Answer:
C program to check whether a string is a palindrome or not – In this article, we will detail in on the multiple ways to check whether a string is a palindrome or not in C programming.
Suitable examples and sample programs have also been added so that you can understand the whole thing very clearly. The compiler has also been added with which you can execute it yourself.
Answered by
13
import java.util.*;
class Palin
{
public static void main (String arg[])
{
Scanner in=new Scanner(System.in);
String d,b=0;
int i,n;
Sopln( "Enter a string");
d=in.nextLine();
n=d.length();
for(i=n-1;i>=10;i--)
{
b=b+d.charAt(i);
}
if(d.equals(b))
{
Sopln("The string is plaindrome");
else
Sopln("The string is not palindrome");
}
}
}
[ Sopln - System.out.println]
Similar questions