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
To create a formula, click the cell where you want to add the formula and press the _____ key.
Ipatiy [6.2K]
C........is the answer
4 0
3 years ago
Read 2 more answers
What type of game is LEAST LIKELY to need a structured narrative?
VladimirAG [237]

Answer:

Probably a sports game

Explanation:

A role-playing means acting it out, so you need to explain the life with a structured narrative.

An adventure game needs lots of background, so you need to fill that in with a structured narrative.

A sports game revolves solely around sports, so you only need to know how to play the game and/or sport, so no structured narrative is needed.

An fps game needs a structured narrative in that it is similar to an adventure game and needs background.

Let me know if I was right! Hope this helped. :)

5 0
3 years ago
What's the answer to this​
yarga [219]

Answer:

S

Explanation:

The index operator will address individual characters in the string.

5 0
3 years ago
Mail merge requires an MS Word document in order to work.<br><br> True<br> False
Kipish [7]

True is correct. Hope it helps


3 0
3 years ago
Read 2 more answers
Jill uses Word to create an order form. She starts out by creating a table that has three columns and ten rows. What should she
kifflom [539]
A is the best answer
I hope it’s work
5 0
2 years ago
Other questions:
  • Which string method counts the number of characters in a string?
    5·1 answer
  • Elizabeth works for a local restaurant at the end of her shift she read she’s required to write in the time that she arrived in
    9·1 answer
  • .Although SQL is a language, you don’t use it to write applications? (true, false)
    8·1 answer
  • A major problem with alcohol adverstising is that
    15·1 answer
  • SATCOM in the Ku- and Ka- bands, as well as EHF systems are adversely affected by rain (the higher the frequency, the greater th
    14·1 answer
  • (Help please I don't know what to choose because it's both text and email but I can only pick one. HELP!!!!!!!!!!)
    6·2 answers
  • Help me pls!!! last question
    9·1 answer
  • Difference between if then and if then else statement ​
    14·1 answer
  • By limiting the number of times a person can use a type of software before registering as the authorized owner of that software,
    15·1 answer
  • Differentiate between refraction of light and reflection of light
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!