Program to Check given String Palindrome

PROGRAM TO CHECK THE GIVEN STRING IN PALINDROME OR NOT


SQL>Ed stringpalindrome.SQL

Declare

N number;

I number;

S varchar 2(20);

T char 2(20);

R char 2 (20);

begin

dbms- output.Put_line (‘ enter string’);

S: = “& S’ ;

T:=S;

L ;=Length (S);

For I in reverse

Loop

R= r || substr (s, I, 1);

End loop

If r: =t

Dbms- output-put line(“given string is palindrome”)

Else

Dbms –output. Putline (“given string is not palindorm’);

End if;

End;


Output

Enter string : Madam

Given string is palindrome.

Related

Oracle 8678993862532133305

Post a Comment

emo-but-icon

item