create or replace procedure rev(n in out integer,rn in out integer,b in out boolean ) is temp integer:=0; di integer:=0; begin temp:=n; while n !=0 loop di:=n mod 10; rn:=rn*10+di; n:=trunc(n/10); end loop; if temp=rn then b:=true; else b:=false; end if; end; / declare a integer :=&a; b integer:=0 ; c integer:=0; d integer:=0; f boolean :=false; begin rev(a,d,f); if f=true then dbms_output.put_line('it is a palindrome'); else dbms_output.put_line('it is not a palindrome'); end if; end; /
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter