Computer Science, asked by julie8604, 4 months ago

Write a function named returnDivisors that accepts a positive integer n as the parameter, and returns a list containing all the divisors of n. Test your function in main. Let user enter an integer from keyboard (your program must be able to check the validation of the entered integer being positive), and then call returnDivisors function which should receive the entered integer as the argument. PYTHON

Answers

Answered by mdatifnasim70mp64jpe
0

function divisors(integer) {

var numb=[];

for (var x=2;x<integer;x++){

if(integer % x == 0){

numb.push(x);

}

}

if (integer%2!=0){

return (integer +' is'+' prime');

}

return numb;

}

Similar questions