subject

Write a program to display all the prime numbers from 2 to 'X' ('X' being entered by the user). Ask the user for an integer greater than 2 (and continue to ask the user for an integer greater than 2 until the user enters a valid number). Then, using a for loop, display all the primer numbers from 2 up to the number entered by the user. Invoke a function from within the for loop, passing it the number between 2 and 'X', have the function return True if the number is prime and False otherwise, and use the return value to determine if the number should be displayed. Name the function IsPrime().

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
question
Computers and Technology, 22.06.2019 22:40
In this lab, you complete a python program that calculates an employee's annual bonus. input is an employee's first name, last name, salary, and numeric performance rating. if the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. if the rating is 4 or higher, the rate is 0. the employee bonus is calculated by multiplying the bonus rate by the annual salary.
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
1. which of the following is a search engine? a) mozilla firefox b)internet explorer c)google d)safari 2. which of the following statements is true? a) all search engines will provide the same results when you enter the same query. b) all search engines use the same amount of advertisements. c) some search engines are also browsers. d) search engines often provide different results, even when you enter the same query.
Answers: 2
question
Computers and Technology, 23.06.2019 09:10
(328 inc. 448 ind. 480 in25. john has a collection of toy cars. he has 2 red cars, 4 blue cars, 4 black cars, and 6 yellowcars. what is the ratio of red cars to yellow cars? a. 1: 2b. 1: 3c. 1: 626. the net of a right triangular prism is shown below.
Answers: 2
You know the right answer?
Write a program to display all the prime numbers from 2 to 'X' ('X' being entered by the user). Ask...
Questions
question
Mathematics, 19.11.2020 07:40
Questions on the website: 13722367