subject

Read in an integer n from the user. You may assume that it is at least 2.
Call a separate function to determine if the number n is prime. You must use call and jumpr instructions to call and return from this separate function. The function should use a loop to determine if n is prime, and it should return the appropriate value: If n is not prime, the function should return the smallest value between 2 and n // 2 that divides into n evenly.
If n is prime, the function should return the number n itself. After the function call has returned, the program should print two values:
the return value of the function
one of two integers:
if n is prime, it should print a 1 (for True)
if n is not prime, it should print a 0 (for False)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
question
Computers and Technology, 24.06.2019 06:50
What are the things you are considering before uploading photos on social media?
Answers: 1
question
Computers and Technology, 24.06.2019 08:30
Aconsumer would pay an extra they used the rent to own program to buy the computer, rather than using cash. for all of the items, is the cheapest option over the life of the contract. the most expensive overall option is to use purchase the item.
Answers: 2
question
Computers and Technology, 24.06.2019 14:30
Two students are discussing the flow of electricity. student a says that voltage is a measure of the amount of electron flow in a circuit. student b says that power is the product of voltage and current. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
You know the right answer?
Read in an integer n from the user. You may assume that it is at least 2.
Call a separate fun...
Questions
question
Mathematics, 04.03.2021 01:00
question
Mathematics, 04.03.2021 01:00
question
Mathematics, 04.03.2021 01:00
question
Mathematics, 04.03.2021 01:00
question
English, 04.03.2021 01:00
Questions on the website: 13722362