SlideShare a Scribd company logo
1 of 1
Download to read offline
Prime numbers. Write a program that prompts the user for an integer and then prints out all
prime numbers up to that integer. - For example, when the user enters 20, the program should
print: 2 3 - 5 - 7 - 11 - 13 - 17 - 19 - Recall that a number is a prime number it it is not divisible
by any number except 1 and itselt, - The program should print an error message it the input
integer is less than 2 .

More Related Content

More from amansarawgi1

Part B Report due in 14 days Collecting and analyzing the data plays.pdf
 Part B Report due in 14 days Collecting and analyzing the data plays.pdf Part B Report due in 14 days Collecting and analyzing the data plays.pdf
Part B Report due in 14 days Collecting and analyzing the data plays.pdfamansarawgi1
 
Pcond the toonerenenty1. Record the issuance of the $15,000 note p.pdf
 Pcond the toonerenenty1. Record the issuance of the $15,000 note p.pdf Pcond the toonerenenty1. Record the issuance of the $15,000 note p.pdf
Pcond the toonerenenty1. Record the issuance of the $15,000 note p.pdfamansarawgi1
 
Problem 2 (20 marks) Inequality and growth in living standards among .pdf
 Problem 2 (20 marks) Inequality and growth in living standards among .pdf Problem 2 (20 marks) Inequality and growth in living standards among .pdf
Problem 2 (20 marks) Inequality and growth in living standards among .pdfamansarawgi1
 
Part 4 Case Study (7 marks) New payroll tax in Lebanon What it will.pdf
 Part 4 Case Study (7 marks) New payroll tax in Lebanon What it will.pdf Part 4 Case Study (7 marks) New payroll tax in Lebanon What it will.pdf
Part 4 Case Study (7 marks) New payroll tax in Lebanon What it will.pdfamansarawgi1
 
Problem 3 (2 points) Suppose an investor can get a return of 7.25 o.pdf
 Problem 3 (2 points) Suppose an investor can get a return of 7.25 o.pdf Problem 3 (2 points) Suppose an investor can get a return of 7.25 o.pdf
Problem 3 (2 points) Suppose an investor can get a return of 7.25 o.pdfamansarawgi1
 
Part 2 Executive Summary Submit a Word document summariaing your ana.pdf
 Part 2 Executive Summary Submit a Word document summariaing your ana.pdf Part 2 Executive Summary Submit a Word document summariaing your ana.pdf
Part 2 Executive Summary Submit a Word document summariaing your ana.pdfamansarawgi1
 
Presented below is information related to Oriole Co., owned by D. Bro.pdf
 Presented below is information related to Oriole Co., owned by D. Bro.pdf Presented below is information related to Oriole Co., owned by D. Bro.pdf
Presented below is information related to Oriole Co., owned by D. Bro.pdfamansarawgi1
 
Part 2 - Fill in the Network Mapping Table (10 Points) For this part .pdf
 Part 2 - Fill in the Network Mapping Table (10 Points) For this part .pdf Part 2 - Fill in the Network Mapping Table (10 Points) For this part .pdf
Part 2 - Fill in the Network Mapping Table (10 Points) For this part .pdfamansarawgi1
 
Problem 2 (4.5 points) Consider a bond with the following feature. A.pdf
 Problem 2 (4.5 points) Consider a bond with the following feature. A.pdf Problem 2 (4.5 points) Consider a bond with the following feature. A.pdf
Problem 2 (4.5 points) Consider a bond with the following feature. A.pdfamansarawgi1
 
Preprocessor directives always begin with the hash symbol (#) and .pdf
 Preprocessor directives always begin with the hash symbol (#) and .pdf Preprocessor directives always begin with the hash symbol (#) and .pdf
Preprocessor directives always begin with the hash symbol (#) and .pdfamansarawgi1
 
Problem 1. Let X1,�,Xn be independent Gamma(,1) random variables. (1.pdf
 Problem 1. Let X1,�,Xn be independent Gamma(,1) random variables. (1.pdf Problem 1. Let X1,�,Xn be independent Gamma(,1) random variables. (1.pdf
Problem 1. Let X1,�,Xn be independent Gamma(,1) random variables. (1.pdfamansarawgi1
 
Problem 1 [10 points]. [Refer DDCA 6.3]. Review the syntax for below .pdf
 Problem 1 [10 points]. [Refer DDCA 6.3]. Review the syntax for below .pdf Problem 1 [10 points]. [Refer DDCA 6.3]. Review the syntax for below .pdf
Problem 1 [10 points]. [Refer DDCA 6.3]. Review the syntax for below .pdfamansarawgi1
 
Problem 1 (20) marks) The scheme below shows causal relationships amo.pdf
 Problem 1 (20) marks) The scheme below shows causal relationships amo.pdf Problem 1 (20) marks) The scheme below shows causal relationships amo.pdf
Problem 1 (20) marks) The scheme below shows causal relationships amo.pdfamansarawgi1
 
Paity has just completed her second semestor in colege. Sho eamed a g.pdf
 Paity has just completed her second semestor in colege. Sho eamed a g.pdf Paity has just completed her second semestor in colege. Sho eamed a g.pdf
Paity has just completed her second semestor in colege. Sho eamed a g.pdfamansarawgi1
 
probaliity far each of the cimple ecents in the uample space. (Po.pdf
 probaliity far each of the cimple ecents in the uample space. (Po.pdf probaliity far each of the cimple ecents in the uample space. (Po.pdf
probaliity far each of the cimple ecents in the uample space. (Po.pdfamansarawgi1
 
Privatization is a form of Government Regulation that serves to stren.pdf
 Privatization is a form of Government Regulation that serves to stren.pdf Privatization is a form of Government Regulation that serves to stren.pdf
Privatization is a form of Government Regulation that serves to stren.pdfamansarawgi1
 
Presented below are variable costing income statements for Sheridan C.pdf
 Presented below are variable costing income statements for Sheridan C.pdf Presented below are variable costing income statements for Sheridan C.pdf
Presented below are variable costing income statements for Sheridan C.pdfamansarawgi1
 
Pre-lecture quiz (Question 4) Which of the following is the major typ.pdf
 Pre-lecture quiz (Question 4) Which of the following is the major typ.pdf Pre-lecture quiz (Question 4) Which of the following is the major typ.pdf
Pre-lecture quiz (Question 4) Which of the following is the major typ.pdfamansarawgi1
 
Pregunta 1 Escribir en el teclado o escribir 100 palabras p.pdf
 Pregunta 1 Escribir en el teclado o escribir 100 palabras p.pdf Pregunta 1 Escribir en el teclado o escribir 100 palabras p.pdf
Pregunta 1 Escribir en el teclado o escribir 100 palabras p.pdfamansarawgi1
 
Pereetual iwrentery using firo The foliowiry units of a barticular in.pdf
 Pereetual iwrentery using firo The foliowiry units of a barticular in.pdf Pereetual iwrentery using firo The foliowiry units of a barticular in.pdf
Pereetual iwrentery using firo The foliowiry units of a barticular in.pdfamansarawgi1
 

More from amansarawgi1 (20)

Part B Report due in 14 days Collecting and analyzing the data plays.pdf
 Part B Report due in 14 days Collecting and analyzing the data plays.pdf Part B Report due in 14 days Collecting and analyzing the data plays.pdf
Part B Report due in 14 days Collecting and analyzing the data plays.pdf
 
Pcond the toonerenenty1. Record the issuance of the $15,000 note p.pdf
 Pcond the toonerenenty1. Record the issuance of the $15,000 note p.pdf Pcond the toonerenenty1. Record the issuance of the $15,000 note p.pdf
Pcond the toonerenenty1. Record the issuance of the $15,000 note p.pdf
 
Problem 2 (20 marks) Inequality and growth in living standards among .pdf
 Problem 2 (20 marks) Inequality and growth in living standards among .pdf Problem 2 (20 marks) Inequality and growth in living standards among .pdf
Problem 2 (20 marks) Inequality and growth in living standards among .pdf
 
Part 4 Case Study (7 marks) New payroll tax in Lebanon What it will.pdf
 Part 4 Case Study (7 marks) New payroll tax in Lebanon What it will.pdf Part 4 Case Study (7 marks) New payroll tax in Lebanon What it will.pdf
Part 4 Case Study (7 marks) New payroll tax in Lebanon What it will.pdf
 
Problem 3 (2 points) Suppose an investor can get a return of 7.25 o.pdf
 Problem 3 (2 points) Suppose an investor can get a return of 7.25 o.pdf Problem 3 (2 points) Suppose an investor can get a return of 7.25 o.pdf
Problem 3 (2 points) Suppose an investor can get a return of 7.25 o.pdf
 
Part 2 Executive Summary Submit a Word document summariaing your ana.pdf
 Part 2 Executive Summary Submit a Word document summariaing your ana.pdf Part 2 Executive Summary Submit a Word document summariaing your ana.pdf
Part 2 Executive Summary Submit a Word document summariaing your ana.pdf
 
Presented below is information related to Oriole Co., owned by D. Bro.pdf
 Presented below is information related to Oriole Co., owned by D. Bro.pdf Presented below is information related to Oriole Co., owned by D. Bro.pdf
Presented below is information related to Oriole Co., owned by D. Bro.pdf
 
Part 2 - Fill in the Network Mapping Table (10 Points) For this part .pdf
 Part 2 - Fill in the Network Mapping Table (10 Points) For this part .pdf Part 2 - Fill in the Network Mapping Table (10 Points) For this part .pdf
Part 2 - Fill in the Network Mapping Table (10 Points) For this part .pdf
 
Problem 2 (4.5 points) Consider a bond with the following feature. A.pdf
 Problem 2 (4.5 points) Consider a bond with the following feature. A.pdf Problem 2 (4.5 points) Consider a bond with the following feature. A.pdf
Problem 2 (4.5 points) Consider a bond with the following feature. A.pdf
 
Preprocessor directives always begin with the hash symbol (#) and .pdf
 Preprocessor directives always begin with the hash symbol (#) and .pdf Preprocessor directives always begin with the hash symbol (#) and .pdf
Preprocessor directives always begin with the hash symbol (#) and .pdf
 
Problem 1. Let X1,�,Xn be independent Gamma(,1) random variables. (1.pdf
 Problem 1. Let X1,�,Xn be independent Gamma(,1) random variables. (1.pdf Problem 1. Let X1,�,Xn be independent Gamma(,1) random variables. (1.pdf
Problem 1. Let X1,�,Xn be independent Gamma(,1) random variables. (1.pdf
 
Problem 1 [10 points]. [Refer DDCA 6.3]. Review the syntax for below .pdf
 Problem 1 [10 points]. [Refer DDCA 6.3]. Review the syntax for below .pdf Problem 1 [10 points]. [Refer DDCA 6.3]. Review the syntax for below .pdf
Problem 1 [10 points]. [Refer DDCA 6.3]. Review the syntax for below .pdf
 
Problem 1 (20) marks) The scheme below shows causal relationships amo.pdf
 Problem 1 (20) marks) The scheme below shows causal relationships amo.pdf Problem 1 (20) marks) The scheme below shows causal relationships amo.pdf
Problem 1 (20) marks) The scheme below shows causal relationships amo.pdf
 
Paity has just completed her second semestor in colege. Sho eamed a g.pdf
 Paity has just completed her second semestor in colege. Sho eamed a g.pdf Paity has just completed her second semestor in colege. Sho eamed a g.pdf
Paity has just completed her second semestor in colege. Sho eamed a g.pdf
 
probaliity far each of the cimple ecents in the uample space. (Po.pdf
 probaliity far each of the cimple ecents in the uample space. (Po.pdf probaliity far each of the cimple ecents in the uample space. (Po.pdf
probaliity far each of the cimple ecents in the uample space. (Po.pdf
 
Privatization is a form of Government Regulation that serves to stren.pdf
 Privatization is a form of Government Regulation that serves to stren.pdf Privatization is a form of Government Regulation that serves to stren.pdf
Privatization is a form of Government Regulation that serves to stren.pdf
 
Presented below are variable costing income statements for Sheridan C.pdf
 Presented below are variable costing income statements for Sheridan C.pdf Presented below are variable costing income statements for Sheridan C.pdf
Presented below are variable costing income statements for Sheridan C.pdf
 
Pre-lecture quiz (Question 4) Which of the following is the major typ.pdf
 Pre-lecture quiz (Question 4) Which of the following is the major typ.pdf Pre-lecture quiz (Question 4) Which of the following is the major typ.pdf
Pre-lecture quiz (Question 4) Which of the following is the major typ.pdf
 
Pregunta 1 Escribir en el teclado o escribir 100 palabras p.pdf
 Pregunta 1 Escribir en el teclado o escribir 100 palabras p.pdf Pregunta 1 Escribir en el teclado o escribir 100 palabras p.pdf
Pregunta 1 Escribir en el teclado o escribir 100 palabras p.pdf
 
Pereetual iwrentery using firo The foliowiry units of a barticular in.pdf
 Pereetual iwrentery using firo The foliowiry units of a barticular in.pdf Pereetual iwrentery using firo The foliowiry units of a barticular in.pdf
Pereetual iwrentery using firo The foliowiry units of a barticular in.pdf
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Recently uploaded (20)

Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 

Prime numbers. Write a program that prompts the user for an integer a.pdf

  • 1. Prime numbers. Write a program that prompts the user for an integer and then prints out all prime numbers up to that integer. - For example, when the user enters 20, the program should print: 2 3 - 5 - 7 - 11 - 13 - 17 - 19 - Recall that a number is a prime number it it is not divisible by any number except 1 and itselt, - The program should print an error message it the input integer is less than 2 .