Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a user-defined function that finds all the prime numbers between two numbe

ID: 3645500 • Letter: W

Question

Write a user-defined function that finds all the prime numbers between two numbers m and n. Name the function pr = prime (m, n), where the input arguments m and n are positive integers, and the output argument pr is a vector with the prime numbers. If m > n is entered when the function is called, the error message "The value of n must be larger than the value of m." is displayed. If a negative number or a number that is not an integer is entered when the function is called, the error message "The input argument must be a positive integer." is displayed. Use the function with: prime (12, 80) prime (21, 63 . 5) prime (100, 200) prime (90, 50)

Explanation / Answer

function v=prime(m,n) if(m>n) disp('the value of n must be larger than value of m.'); else if((isinteger(m)) && (isinteger(n))) disp('the input should be integrs'); else if(m
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote