Question: LC3 full program Input The input for this assignment consists of two natural numbers a and b such that 2 a, b 20000 which denote

LC3 full program

Input

The input for this assignment consists of two natural numbers a and b such that 2 a, b 20000 which denote the range [a, b]]. a and b are separated by a single space and followed by a new line character. Note that the range can also be decreasing instead of increasing. An example of this is a = 5 and b = 1.

Output

First, you should print numbers a and b followed by a new line character. Next, for any number x in the range [a, b] there are two options: 1) x is a prime number. In this case, you should print x is a prime number, where x denotes the value of x; 2) x is not a prime number. In this case, you should print x is not a prime number as it is divisible by y, where x denotes the value of x and y denotes the value of the smallest divisor of x. Note that if the range is decreasing (e.g. a = 5, b = 1) you should also print your results in decreasing order of x.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!