Question: (matlab) Use N=100 7. Finding prime numbers. Write a program, FindPrimes.m, that examines each integer from 1 to N to see if the number is
7. Finding prime numbers. Write a program, FindPrimes.m, that examines each integer from 1 to N to see if the number is a prime. If it is prime (and only then), print out the number. Use the MATLAB function isprime (k), which returns the value true if k is prime. The program should print out all the primes less than or equal to N. Use N = 100 as a test case. >> FindPrimes N= 100 Found Prime: 2 Found Prime: 3 Found Prime: 5 Found Prime: 7 Found Prime: 11 (etc.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
