Class 10th ICSE

Q.10

WAJP to check whether the given string is palindrome or not. EXAMPLE MADAM It is a palindrome

import java.util.*;
class Palindrome{
public static void main (){
String n,rev=””;
int i;
Scanner sc= new Scanner (System.in);
System.out.println(“Enter a word “);
n=sc.nextLine();
int l=n.length();
for(i=l-1;i>=0;i–){
rev=rev+n.charAt(i);
}
if(n.equals(rev))
System.out.println(“It is a palindrome”);
else
System.out.println(“It is not a palindrome”);
}

Fun & Easy to follow
Works on all devices
Your own Pace
Super Affordable

Popular Videos

Play Video

UX for Teams

Learn the basics and a bit beyond to improve your backend dev skills.

ava4.png
Chris Matthews

Designer

Play Video

SEO & Instagram

Learn the basics and a bit beyond to improve your backend dev skills.

ava4.png
Chris Matthews

Designer