133k views
5 votes
ShowPrimes and IsPrime functions: What does the ShowPrimes function do?

a) Display n prime numbers
b) Generate candidate primes
c) Evaluate if a number is prime or not
d) Both a and b

User Atoumey
by
7.3k points

1 Answer

3 votes

Final answer:

The ShowPrimes function generates and displays prime numbers, while the IsPrime function evaluates if a number is prime or not.

Step-by-step explanation:

ShowPrimes is a function that generates and displays n prime numbers. It takes a parameter 'n', which specifies the number of primes to be displayed.

The IsPrime function, on the other hand, evaluates whether a given number is prime or not. It takes a parameter 'num' and returns a boolean value, true if the number is prime and false otherwise.

Therefore, the correct answer is d) Both a and b.