(Primes) As you should know, a prime number is any whole number greater than 1 that is divisible by only itself and 1. For this problem, you will be considering only numbers that are less than 10, and so you may simply enumerate the primes.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 3E
icon
Related questions
Question

make madelab code 

(Primes) As you should know, a prime number is any whole number greater than 1
that is divisible by only itself and 1. For this problem, you will be considering only
numbers that are less than 10, and so you may simply enumerate the primes.
is_prime_lt_10 Function:
Input variables:
• a scalar integer between 1 and 10
Output variables:
• a string that says whether the given number is prime; the string should
be of the form
XX is prime
or
XX is not prime
where XX is the given number
A possible sample case is:
> prime = is_prime_lt_10(2)
prime
2 is prime
Transcribed Image Text:(Primes) As you should know, a prime number is any whole number greater than 1 that is divisible by only itself and 1. For this problem, you will be considering only numbers that are less than 10, and so you may simply enumerate the primes. is_prime_lt_10 Function: Input variables: • a scalar integer between 1 and 10 Output variables: • a string that says whether the given number is prime; the string should be of the form XX is prime or XX is not prime where XX is the given number A possible sample case is: > prime = is_prime_lt_10(2) prime 2 is prime
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning