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
For what reason can security risks never be fully eliminated?​
raketka [301]

Answer:

A vulnerability level of ZERO can never be obtained since all countermeasures have vulnerabilities themselves. For this reason, vulnerability can never be zero, and thus risk can never be totally eliminated.

Explanation:

also we need to be protected from scams and stuff

7 0
3 years ago
Desertification is caused by
Alex Ar [27]
<span>it is caused by A.overgrazing
</span>
5 0
3 years ago
What is the correct html element for playing video files?
Neko [114]
HTML stands for Hyper Text Markup Language. It is the most commonly language used for <span>creating web pages and web applications. </span>

<span>The correct HTML element for playing video files is <video>.
</span>

To show a video in HTML, use the <video> element:

Example:<span><video<span> width="320" height="240" controls</span>></span>
  <span><source<span> src="video 1.mp4" type="video/mp4"</span>></span>
  <span><source<span> src="movie.ogg" type="video/ogg"</span>></span>
<span></video<span>></span></span>
4 0
3 years ago
Read 2 more answers
Hey does anyone think nervegear would be possible? (Just asking)
Vlada [557]

Answer:

Depends

Explanation:

Technology is not advanced yet, so building a fully functional nerve gear is difficult. It could be possible in a few years though.

7 0
3 years ago
Read 2 more answers
You can enter the following things in cells
katrin [286]

Answer:

You enter three types of data in cells: labels, values, and formulas.

Explanation:

I hope this is the right answer I knew it on top of my head but I made sure with goggle to.

3 0
2 years ago
Other questions:
  • Which of the following statements about the OSI is FALSE?A. The OSI model encourages modular design in networking.B. Each protoc
    8·1 answer
  • Word offers a multitude of picture formatting options that allow you to flip, rotate, and make many other adjustments to inserte
    15·1 answer
  • Which function should be used to display a value based on a comparison?
    11·1 answer
  • What are some of the advantages of using the F measure (weighted harmonic mean) over using the Precision &amp; Recall when evalu
    15·1 answer
  • Simple mail transfer protocol (smtp) uses the well-known port number ______________ by default.
    14·2 answers
  • Question 16 of 40
    9·2 answers
  • Which types of computers are used by large businesses
    10·1 answer
  • the front desk of the Nocete's Hotel will comlute the total room sales (TRS) of Room 101.The room was occupied three times and t
    6·1 answer
  • How can a cell phone tower help people​
    11·2 answers
  • What does business informWhat does business information management do?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!