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
arsen [322]
2 years ago
10

Write a program to print the prime numbers from 500 to 700. The program should also print the count of prime numbers between 500

and 700. A number is called a prime number if it has exactly two positive divisors, 1 and the number itself. For example, the number 5 is prime as it has only two divisors: 1 and 5.
Computers and Technology
1 answer:
S_A_V [24]2 years ago
8 0

primes = 0

for x in range(500, 701):

   count = 1

   for w in range(2, x+1):

       if x % w == 0:

           count += 1

   if count < 3:

       print(x, end=" ")

       primes += 1

print("\nThere are {} prime numbers between 500 and 700".format(primes))

I hope this helps!

You might be interested in
If a= ‘ Stay home, Stay safe’ , print its value
Damm [24]

Answer:

Since the language isn’t stated, I’ll give answers in the two most-used (?) languages: Java and Python.

a) To print a’s value 3 times in the same line, in Java we would do:

System.out.print(a+a+a);

In Python, we would write:

print(a*3)

b) 2 times in different lines using one print statement

In Java, we would write

System.out.println(a+”\n”+a+”\n”+a);

In Python we would write:

print(a,a,a,sep=’/n’)

Hope this helps!

7 0
2 years ago
Ignore this it a temporary note for me: SPSstudents
Westkost [7]

Answer:

okk

Explanation:

3 0
2 years ago
A ___________ variable is declared outside all functions.
velikii [3]

Answer:

B. global

Explanation:

A global variable lives on even when a function returns.

7 0
3 years ago
What is an iterator and why is it useful for ADTs?
VladimirAG [237]

Answer:

Iterator is the element that used for transversing of any container by the user. This provides the facility to user to process any constituent belonging to the container and storage of these elements can be in any form.

This situation takes place under the isolation condition of the user from the container's internal model. Abstract data types use iterators for the maintenance of the transversal of the data structure.

4 0
3 years ago
Why is derek miller's social media post different than most?
fgiga [73]
In the scenario in which Derek Miller's social media post is different than most since Miller had his family and friends write a post after he died with the letter he wrote. Hope this is the answer and would be of help.
5 0
3 years ago
Other questions:
  • Business ethics are?
    9·1 answer
  • Developers work together with customers and useras to define requirements and specify what the proposed system will do. If once
    9·1 answer
  • A security policy is a
    11·1 answer
  • A project manager is responsible for (check all that apply)
    13·1 answer
  • Does a 21.6v battery work with a 24 volt controller
    6·1 answer
  • Jonathan is in the process of creating a photo of a fluttering flag with cars moving around in the background. He wants the flag
    13·2 answers
  • HELP FAST PLEASE
    6·1 answer
  • I NEED HELP!!! BRAINLIEST!!!
    14·2 answers
  • How many hours do you spend on the Internet per day?
    11·2 answers
  • you want to upgrade your windows 10 professional computer to windows 11 professional. you begin by checking the hardware and dis
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!