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
choli [55]
3 years ago
13

Write a function, factors, that takes an integer n, and returns a list of values that are the positive divisors of n. Note: 0 is

not a divisor of any integer, 1 divides every number, and n divides itself.
Computers and Technology
1 answer:
Helen [10]3 years ago
4 0

Answer:

public int[] factors(int n)

{

int arr[]=new int[n];

int count=0;

for(int i=1;i<=n;i++)

if(n%i==0)

{

arr[count]=i;

count++;

}

return arr;

}

Explanation:

Factors are the numbers you multiply to get another number. For instance, factors of 15 are 3 and 5, because 3×5 = 15.

In the program , we have an array of length N to store the factors.

Since we don't know the number of factors of N, so we have taken size of upper bound N to store list of factors in the array arr.

Within the loop the number gets divide by Integers from 1 to that number until result is 0. If it is 0, that number is stored in array.

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
8_murik_8 [283]
I would go with A) The Internet 


I hope that turns out well for you. Good luck! (:
6 0
3 years ago
What word does<br> this pattern spell?<br> d.
Advocard [28]

Answer:

BEG

Explanation:

In traditional music theory, pitch classes are typically represented by first seven Latin alphabets (A,B,C,D,E ,F and G) . And in the below music notes attachment we can understand that the answer is option (a) BEG

7 0
4 years ago
How to get amount after a percentage increase in excel​
Tresset [83]

Answer:

First: work out the difference (increase) between the two numbers you are comparing.

Increase = New Number - Original Number.

Then: divide the increase by the original number and multiply the answer by 100.

% increase = Increase ÷ Original Number × 100.

Explanation:

3 0
2 years ago
Read 2 more answers
Wyjaśnij w jaki sposób wykonuje się nitowanie zakładkowe i nakładkowe, oraz wyjaśnij na czym polega pasowanie mieszane.
Ksenya-84 [330]

Answer:

????

Explanation:

i dont speak this language

7 0
3 years ago
(multiple choice)Select the items that describe possible problems with being unemployed and not earning income.
alexandr402 [8]

When someone is unemployed and not making any income for him or herself, or her or his family, a lot of impacts would be felt by them. They would not be able to afford food for themselves, or support their families in any way that requires monetary relief. They would also have problems in paying for medical treatments. Problems with paying rents and mortgages would also be faced by them.

Thus, the best answer to the question would be all of the above.

5 0
3 years ago
Read 2 more answers
Other questions:
  • I need some cool things to do with windows command prompt.
    13·1 answer
  • What is the correct posting of the journalized transaction shown in figure 3.03 to the accounts payable subsidiary ledger?
    9·1 answer
  • A technician is trouble-shooting an IDE hard drive that is emitting a humming sound. They suspect a faulty connector. Which of t
    6·1 answer
  • 5. RAM IS YOUR SYSTEM’S-
    14·2 answers
  • What occurs when an application sends user-fed data directly to a web browser without authenticating or deleting the content? Cr
    15·1 answer
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    8·1 answer
  • After you have located a program name from the Start menu, in order to create a shortcut on the desktop.
    8·1 answer
  • 9. These particular machines can be decentralized.
    9·1 answer
  • Spreadsheets are sometimes credited with legitimizing the personal computer as a business tool. Why do you think they had such a
    13·1 answer
  • What is it called when you define a variable for the first time
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!