Computers and Technology, 27.11.2019 19:31, luckylady
Write a function called factors of number that takes as input a positive integer and returns the factors of the positive integer as an array. for example, if the integer is 6, the output is an array consisting of the values [1 2 3 6]. test your function on the following numbers: 26, 64, 97 and 187
1 and the number itself are always factors.
2. to find other factors, check up to the floor of the squareroot of the number. for example, if the number is 10, floor (squareroot 10) = 3.
a. 10 mod 2 equals 0. that means 2 and 5 (which is 10/2) are factors. in this case, it is ok to dynamically grow your array.
b. 10 mod 3 equals 1, which means 3 is not a factor. since we check up to 3, this completes the function and we return [1 10 2 5] as the factors of 10 (order is not important).
Answers: 1
Computers and Technology, 24.06.2019 04:30, andrespacheco5888
Which of the following terms refers to a collection of different types of software that share the goal of infiltrating a computer and making it do something? a- malware b- virus c- spyware d- trojan horse
Answers: 2
Computers and Technology, 24.06.2019 13:00, sparkyjones02
Which best describes the condition under which the unicode output is the same as plain text ?
Answers: 1
Write a function called factors of number that takes as input a positive integer and returns the fac...
Biology, 28.07.2019 09:40
Physics, 28.07.2019 09:40
Mathematics, 28.07.2019 09:40