SlideShare a Scribd company logo
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.pdf
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 
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
amansarawgi1
 

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

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 

Recently uploaded (20)

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 

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 .