Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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,
out
outPrimes
Function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started