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
dlinn [17]
2 years ago
13

Factoring of integers. Write a python program that asks the user for an integer and then prints out all its factors. For example

, when the user enters 150, the program should print 2 3 5 5.
This is just a pseudocode for visual:
Get a value from user Print
"The factors are: "
Keep going while the value is greater than 1
Start the divisor at 2 A factor has not been found Keep going until a factor is found
If the value is evenly divisible by the divisor
A factor has been found
Print the divisor Change value to equal value / divisor.
You have now found a factor you want to see if there are factors in the remaining part of the number.
FYI: For instance if the number is 100, your first factor would be 2 and on our second time through you would need to see if there are factors of 50. This would result in another factor of 2 in the third pass and looking for factors of 25. This would result in a factor of 5 in the fourth pass and looking for factors of 5. This would result in value finally = 1 so you are done. If I enter 175, I would see 5, 5, and 7 as my results. Increment the divisor so you can see if the next number is a factor. This statement is not necessary if a factor is found, but it does not matter if it is executed because you will fall out of the inside nested if and reset the divisor to 2 if you come back in.
Computers and Technology
1 answer:
Oduvanchick [21]2 years ago
8 0

num = int(input("Enter a number: "))

i = 2

while num > 1:

   if num % i == 0:

       num = num / i

       print(i, end=" ")

       i = 2

   i += 1

I hope this helps!

You might be interested in
My mom works from home selling her craft work online to people all over the world. She can do this from home because we have acc
postnew [5]
The computer and a device
7 0
3 years ago
Read 2 more answers
SOMEONE HELP PLEASE ​
exis [7]
Do what?? please tell me
3 0
2 years ago
Which of the following reflects Moore's law? Multiple Choice The doubling of computer chip performance per dollar every two year
Katena32 [7]

Answer:

The correct answer is A.

Explanation:

Moore's Law states/predicts that the maximum number of transistors that can be used on integrated circuits (processors etc.) will be doubled every two years so it basically predicts an exponential growth in terms of transistors used.

Doubling the number of transistors used means that it will almost certainly increase the performance of the processors. Of course there are a lot of other variables that the performance depends on but Moore's Law is proven to be true and  is being used since 1960's. The answer given in option A is the one that best reflects on this law.

I hope this answer helps.

4 0
2 years ago
This is a device that enables computers to be connected to a network.
zhuklara [117]

The answer to your question is,

NIC - Network Interface Card

-Mabel <3

8 0
3 years ago
A consumer purchases an exploit from the dark web. The exploit targets the online shopping cart on a popular website, allowing t
Bond [772]

Answer:

Script Kiddie

Explanation:

According to my research on Black Hat Hackers, I can say that based on the information provided within the question the term that best describes this type of user is called a Script Kiddie. This is known as a person who uses already created computer scripts to hack into computers since they do not have the skills to write the scripts themselves.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

4 0
3 years ago
Other questions:
  • Aria has modified the hard disk that hosts the operating system by using the fdisk command. The fdisk command indicates that the
    8·1 answer
  • The process of changing a program’s internal structure without changing the way the program works is ______________.
    13·1 answer
  • How to delete account on this
    7·2 answers
  • What are static components in a multimedia system?
    15·2 answers
  • A social cause is: O A. when one person protests without the support of others. B. something that not many citizens think or car
    8·1 answer
  • The term phreaker is now commonly associated with an individual who cracks or removes software protection that is designed to pr
    13·2 answers
  • what is the arrangement of various flash elements, such as the tools panel, control panel, property inspector and stage
    12·1 answer
  • Need help with this, will give brainliest
    15·1 answer
  • The internet is ________. an internal communication system for businesses a large network of networks a communication system for
    6·1 answer
  • The ________ function will change a character argument from lowercase to uppercase. isupper toupper tolarge fromlower none of th
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!