PL/SQL Program for Prime Number

Here you will get a pl/sql program for prime number.

A number is a prime number if it is divisible by 1 or itself. For example 2, 3, 5, 7, etc are prime numbers.

While numbers like 4, 6, 8, etc are not prime.


PL/SQL Program for Prime Number



Enter value for n: 12
old 9: n:=&n;
new 9: n:=12;
not prime

7 thoughts on “PL/SQL Program for Prime Number

  1. Sairam

    Hii …we want full pl/SQL programme’s if don’t mine it will we send to my site.

    1. Gunjan

      if half of the values of n does not give remainder 0 then the higher values preceding n/2 will also not give reminder zero and it also improves performance of the code as you are executing the condition for half of the length.
      hope u got it.

  2. Venkat

    Wont work if input is 2 . For input 2 it will show not a prime.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.