Question: Please write an anonymous PL / SQL program to check whether the number 1 0 0 1 is a prime number ( a number that

Please write an anonymous PL/SQL program to check whether the number 1001 is a prime number (a number that cannot be divided by any number other than 1 and itself). Print out a message '1001 is a prime number ' if 1001 is a prime number and '1001 is not a prime number' otherwise.
Hint: You can check whether 1001 can be divided by any odd integer that is greater than 1 but less or equal to square root of 1001.
sqrt(x) returns square root of x in PL/SQL. mod(x,y) returns remainder of dividing x by y.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!