PL/SQL code to check input number is palindrome or not
DECLARE
no integer;
dummy integer;
temp integer :=0;
BEGIN
no := &enter_numer; --To take input from user
dummy := no;
while(dummy !=0)
loop
temp :=(temp*10) +MOD(dummy ,10);
dummy := dummy / 10;
end loop;
if temp = no then
dbms_output.put_line('palindrome');
else
dbms_output.put_line('Not palindrome');
end if;
end;
No comments:
Post a Comment