PL/SQL block to check if a number is Prime
Q. Write a PL/SQL block to check weather a given number is Prime or not.
It is a natural number greater than 1 and has no positive divisor other than 1 and itself.
5 is prime number because, number 5 has 1 and 5 are only positive integer factors.
The following program will check weather a given number is prime or not.
for i in 1..num
dbms_output.put_line(num||' not a prime');
dbms_output.put_line(num||' is prime');