This is the same as the preceding exercise. But this time, you should use a procedure to do the work.

Write a program that writes the first 20 prime numbers, one number per line. Do that by defining a procedure, WritePrimes(howMany), that writes the first howMany prime numbers. Then make an Execute part that just does WritePrimes(20).

For this problem, a function isPrime(n) is available to you, which yields true if n is prime.

 

    [Language: Cinnameg  Kind: program]