declare a integer:=&a; c integer:=0; i integer; begin for i in 2 .. a-1 loop if (mod(a,i)=0) then c:=c+1; end if; end loop; if c=0 then dbms_output.put_line('Prime number'); else dbms_output.put_line('Not Prime Number'); 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