Question: Write a procedure ISPRIME whose input is a positive integer n and whose output is true if n is prime and false otherwise. Test the
Write a procedure ISPRIME whose input is a positive integer n and whose output is true if n is prime and
false otherwise. Test the procedure on the following numbers:
The answers should be
false, true, true, false, true, false, false, true, false, true.
Hint: Here's a start for the program:local d;
if n then return false; end if;
if n then return true; end if;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
