Computer Science, asked by 09876543237, 7 months ago

Program 9:
Special words are those words which starts and ends with the same letter. [15]
Examples:
EXISTENCE
COMIC
WINDOW
Palindrome words are those words which read the same from left to right and vice-
versa.
Example:
MALAYALAM
MADAM
LEVEL
ROTATOR
CIVIC
All palindromes are special words, but all special words are not palindromes.​

Answers

Answered by CoderRishav
9

special words

import java.util.*;

public class spc_no

{

public static void main()

{

Scanner in = new Scanner(System.in);

String n = in.next();

if (n.charAt(0) == n.charAt(n.length-1))

System.out.println("Special");

else

System.out.println("Not Special");

}

}

pallandrome

import java.util.*;

public class Pall

{

public static void main()

{

Scanner in = new Scanner(System.in);

String pal = in.next();

if (pal == pal.reverse())

System.out.println("Pallendrome");

else

System.out.println("Not Pallendrome");

}

}

please vote it :)

and marks as brailist :)

Similar questions