Question: Prime Numbers Exercise: (Pseudo code and Flowchart). A prime number is a number that is only evenly divisible by itself and 1. Design a Boolean function named isPrime which takes an integer as an argument and returns True if the argument is a prime number, or False otherwise. |
Solution: Function main //Declare variables //Get the number //value returned by call to isPrime (number) function assigned to result If result is equal to True Then //nothing (value zero) is returned by main to operating system Function isPrime //Declare variables count = two //while loop //prime is returned by this function |