Question: Mini - Project 3 Write a function called FindPrimes that takes 2 scalars, lowerRange and upperRange, and produces 2 output arrays called outOdds and outPrimes.
MiniProject
Write a function called FindPrimes that takes scalars, lowerRange and upperRange, and produces output arrays called outOdds and outPrimes.
Step : The function first finds all the odd numbers within the range defined by lowerRange and upperRange, limits inclusive. The output outOdds is a D array with all the odd
numbers, except integer multiples of within the specified range.
Step : outPrimes contains all prime numbers above the lowerRange in ascending order while the sum of the outPrimes is less than the highest element of outOdds.
The input arguments lowerRange upperRange are two numeric scalars.
The output argument outOdds and outPrime are numeric arrays.
Hint: Use isprime to check if a numer is prime.
For example: For the given inputs:
lowerRange ;
upperRange ;
On calling FindPrimes:
outdds outPrimes FindPrimes lowerRange, upperRange
produces,
Function e
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
