answersLogoWhite

0


Best Answer

Algorithm: to generate all prime numbers between the limits l1 and l2.

Input: l1 and l2

Output: Prime numbers between l1 and l2

Method:

for (n=l1 to l2 in steps of 1 do)

prime=true

for (i=2 to n/2 in steps of 1 do)

if (n % i =0)

prime = false

break

end_if

end_for

if (prime = true)

Display 'Prime number is =', n

end_for

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Design a algorithm to generate all prime numbers within the limits l1 and l2?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How many pounds can an airplane hold?

Depends on its design limits.


What is a factor that limits technology design?

A constraint


Are there limits to how fast the wind can be to generate electricity?

There is no particular set limit, but the winds we can use to generate electricity are not boundless. Winds that are too strong will damage wind turbines.


Why are criteria and constraints important to a design?

it is the limits and necessity of the designs that allow it to function correctly and provid ethe consumer with a pleased design


What are two disadvantages of mass production?

Mass production is: - Inflexible - Limits the design of products


How do you block numbers fom calling you on your LG Xenon?

Add Smart Limits from AT&T they will allow you to add up to 15 blocked numbers to your account, most phones today do not allow you to block numbers, smart limits is 4.99 per month.


Determine the control limits for the mean and the range?

In mathematical terms, mean is the average of all numbers, and rang is the difference of the highest and lowest numbers in the set. Control limits refers to the lines drawn on statistical charts.


What limits the speed of boat?

Type your answer here... Mainly engine size, overall weight, hull design.


What is the difference between a column constraint and a table constraint?

column constraint is for a single column. table constraint is for an entire table.


Is it true that a constraint is any factor that limits or restricts a design?

true because that is what it says in the glossary of my science book :)


What is the name for the idea that a member of congress can only be elected a certain numbers of times?

Term limits


Why cant the wind turbine generarte electricity all the time?

They can only generate energy when there is a wind blowing, there are limits to the strength of the wind it must not be too strong or too gentle