1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Jobisdone [24]
3 years ago
6

Write a program that prompts the user for an integer and thenprints out all prime numbers up to that integer. For example,when t

he user enters 20, the program should print out:
2
3
5
7
11
13
17
19
Note: A prime number is not divisible by any number except 1and itself.
Computers and Technology
1 answer:
MaRussiya [10]3 years ago
8 0

Answer:

n=int(input("Enter number upto which you want to print prime numbers:\n"))#taking input of n in integer type..

for i in range(1,n): #looping over 1 to n.

   pr=True  #taking pr to be True..

   for div in range(2,i): #looping over 2 to i..

       if i%div==0:#if i is divisible by div then it is not prime

           pr=False#making pr false

   if pr and i!=1: #condition for printing

       print(str(i))#printing the prime numbers..

       

Explanation:

In the python program we have checked for every integer up to n that is is not divisible by any integer between 2 to n-1 both inclusive if it is then it is not a prime number.

You might be interested in
As with country citizenship, with digital citizenship comes _____.
deff fn [24]

Answer: Responsible Technology usage

Explanation: Digital citizenship refers to the responsible use of technology, and the teaching of digital citizenship is essential to help students achieve and understand digital literacy, as well as the prevention of cyber bullying, online security, digital responsibility and digital health and wellness. to ensure

6 0
3 years ago
Read 2 more answers
Describe how a user would interact with a smart-phone to do various tasks.Consider inputs and outputs.
xz_007 [3.2K]

A smart-phone is also referred to as a mobile device and it can be defined as a small, portable, programmable-electronic device that is designed and developed for sending (transmission) and receiving data (messages) over a network. Thus, a smart-phone must be designed as a hand-held device with communication capabilities.

Basically, the components that make up a smart-phone can be classified into two (2) main categories and these include:

1. <u>Input:</u> it comprises mouthpiece, keyboard, light sensor, etc.

2. <u>Output:</u> it comprises screen, speaker, earpiece, etc.

In this context, an end user would interact with a smart-phone in the following ways to perform (do) various tasks:

  • By using a keyboard to type a text and then sending it to another person.
  • By using a mouthpiece as an input for voice (audio) messages when making call.
  • The screen of a smart-phone displays the necessary information to an end user.
  • When playing a digital music file the speaker produces the output as sound.

Read more on smart-phone here: brainly.com/question/4922532

7 0
3 years ago
Hurry answerrrrrrr pleaseee
natka813 [3]

Answer:

bright colors around dull surroundings

Explanation:

4 0
3 years ago
Read 2 more answers
A struggle between opposing forces or characters is
tamaranim1 [39]

Answer:

Conflicts

Explanation:

The struggle between two opposing forces or characters in a story. Conflicts can exist between two people, between a person and nature or a machine or between a person a whole society. a conflict can be internal, involving opposing forces within a person's mind.

4 0
3 years ago
Write a machine-language program to add the three numbers 2, –3, and 6 and output the sum on the output device. Write it in a fo
olya-2409 [2.1K]

Answer:

Below is the code ...hope it meet the requirements

lda 0, i

adda 6, i

suba 3, i

adda 2, i

STA 0x0010 ,d

CHARO 0x0010 ,d

.end

Explanation:

8 0
3 years ago
Other questions:
  • select three types of school which specifically emphasize learning through creativity, self expression, and play
    10·2 answers
  • Whereas lines of competition are clearly defined in the more established industries, in the Internet industry they are blurred a
    9·1 answer
  • A media scholar is trying to find out whether internet or television political ads are more persuasive. what kind of effects is
    7·1 answer
  • The advent of optical discs was made possible by developments in ____ technology.
    5·1 answer
  • Microsoft windows malicious software removal tool fake or real
    8·1 answer
  • What do we call data that's broken down into bits and sent through a network?
    15·1 answer
  • Which feature is used to change how a presentation moves from slide to slide?
    14·1 answer
  • How do I start conversations with ppl??? If u answer right I will try send u more points... So please help me
    7·1 answer
  • What is E-Commerce? Answer The Following. Pls Help Me​
    5·1 answer
  • What code would you use to create the login button?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!