subject

A prime number is an integer that is divisible only by 1 and by itself. Write a program that: 1. Takes a number as an input.

2. Prints back to the console all the primes that are larger than 1 but not larger than the number that has been entered.

You need to have a procedure called isPrime. You may have more procedures if you like.

1. This procedure receives a number through one of the registers.

2. Checks if this number is prime.

3. Returns back through one of the registers to the main program 1, if the number is prime, 0 otherwise.

sample run:

Please enter a number: 44

Primes found until the given number:

2 3 5 7 11 13 17 19 23 29 31 37 41 43 Press any key to continue . . .

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
You install teamviewer on your workstation at home so that you can ac ess it when on the road. how can you be assured that unknown users cant access your computer through team viewer?
Answers: 2
question
Computers and Technology, 22.06.2019 22:50
Which is the best minecraft server? a. mineplex b. worldonecraft c. 9b9t d. 2b2t
Answers: 2
question
Computers and Technology, 24.06.2019 17:30
What is the main difference between cloud computing and saas? cloud computing is a platform, and saas is software. cloud computing is software, and saas is a platform. cloud computing is a service, and saas is software. cloud computing is a service, and saas is a platform.
Answers: 1
question
Computers and Technology, 25.06.2019 00:30
How do i take a screenshot on a laptop?
Answers: 2
You know the right answer?
A prime number is an integer that is divisible only by 1 and by itself. Write a program that: 1. Ta...
Questions
question
Mathematics, 13.08.2021 04:20
question
Mathematics, 13.08.2021 04:20
Questions on the website: 13722363