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
Rudik [331]
3 years ago
6

write a program that asks the user to enter a positive integer, then prints a list of all positive integers that divide that num

ber evenly, including itself and 1, in ascending order. when you run your program, it should match the following format: please enter a positive integer: 12 the factors of 12 are: 1 2 3 4 6 12 the file must be named: factors.py
Computers and Technology
1 answer:
Stolb23 [73]3 years ago
3 0

Answer:

<em>The program is written using python</em>

<em>See explanation section for detailed explanation; as the program does not accommodate comments.</em>

<em>Program starts here</em>

num = int(input("please enter a positive integer: "))

print("The factors of",num,"are:")

for i in range(1, num + 1):

    if num % i == 0:

         print(i)

Explanation:

This line prompts the user for input

num = int(input("please enter a positive integer: "))

This line prints a string literal which states the factors of the input number

print("The factors of",num,"are:")

The next line is a for statement that iterates all positive numbers from 1 till the inputted number

for i in range(1, num + 1):

This next line checks for the factors of the user input by checking for remainders.

    if num % i == 0:

Lastly, the factors are printed

         print(i)

You might be interested in
If an internet document identifies its author but says nothing about her or his qualifications, your textbook recommends that yo
PSYCHO15rus [73]

If the internet document identifies the author, the textbook recommends that you type the author's name into the internet search box.

<h3>What is an internet document?</h3>

These are those documents that are gotten from the a search on the internet. To cite such items there are certain guidelines that are to be followed.

A simple search on a search engine would show you the most important details that this author possesses.

Read more on internet documents here:

brainly.com/question/14715750

5 0
2 years ago
Write a function that receives two numbers, m and n and calculates and displays the sum of the integers from m to n. For example
Evgesh-ka [11]

Answer:

The program to this question as follows:

Program:

//header file

#include <stdio.h> //defining header file

void inc(int m,int n) //defining method inc

{

   int sum, i; //declaring variable

   sum=m; //holding value of m variable

   for(i=++m;i<=n;i++) //loop for calculate number between given range  

   {

   sum=sum+i; //adding value

   }

   printf("sum of the integer is : %d",sum);//print value

}

int main() //defining method

{

   int m,n; //defining integer variable

   printf("Enter m value: "); //message

   scanf("%d",&m); //input value by user in variable

   printf("Enter n value: "); //message

   scanf("%d",&n);//input value by user in variable

   inc(m,n); //calling method

   return 0;

}

Output:

Enter m value: 3

Enter n value: 7

sum of the integer is :25

Explanation:

In the above code, an "inc" function is declared, that accepts integer parameters that are "m and n", inside the method two integer variable "sum and i" is declared, which is used in the loop.

  • The loop uses the user parameter to count value and uses the sum variable to calculate there sum.
  • In the main method, two integer variable n and m are declared, which take value from the user end, and at the last, we call the inc method, that prints sum value.
7 0
2 years ago
7.2 code practice edhesive
goblinko [34]

Answer:

Explanation:

got a 100

7 0
3 years ago
Read 2 more answers
An administrator needs to make sure that video conferencing is allocated a high portion of bandwidth within a company network. W
frosja888 [35]

Answer:

QoS

Explanation:

We could use a blacklisting or a MAC filtering to remove from the network, and in this way, we're going to get a high portion of bandwidth, but other must work too, and the whitelisting have almost the same function, but QoS Quality of service is specifically for these cases where we need high bandwidth for a video conference, we can make this with some tools or techniques like jitter buffer and traffic shaping.

4 0
3 years ago
Drag the tiles to the correct boxes to complete the pairs.
Zepler [3.9K]

Answer:

the answer is to fail

Explanation:

4 0
3 years ago
Other questions:
  • ______ is a certification program that recognizes sustainable building practices and strategies. Question 1 options: A) Brundtla
    10·1 answer
  • If you’d like to have multiple italicized words in your document, how would you change the font of each of these words?
    7·2 answers
  • A(n) ________ address is a temporary ip address assigned from an available pool of ip addresses.
    12·1 answer
  • If Denise specifies Jan? as a search criterion, Excel will locate all of the following records EXCEPT ____.
    9·1 answer
  • Traceability of requirements is helpful in the followingexcept
    5·1 answer
  • What will be the results of executing the following statements? x.setEditable(true); x.setText("Tiny Tim"); a. The text field x
    7·1 answer
  • To save time and avoid formatting errors, you can use the ____ to apply custom formatting to other places in your presentation q
    9·1 answer
  • Clarice is an architect who is involved in design work on a restaurant in a building that used to be part of the city’s water wo
    8·1 answer
  • Does anyone know what i did wrong?
    13·1 answer
  • El botón de layout se usa para <br>​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!