Jump to content

Factors of an integer: Difference between revisions

m
fix bare lang tags
m (fix bare lang tags)
Line 428:
 
return 0;
}</lang>output<lang>3: 1 3
<pre>3: 1 3
120: 1 2 3 4 5 6 8 10 12 15 20 24 30 40 60 120
1024: 1 2 4 8 16 32 64 128 256 512 1024
3491888400: 1 2 3 4 5 6 7 8 9 10 11 ...(>1900 numbers)... 1163962800 1745944200 3491888400</langpre>
 
=={{header|C++}}==
Line 699 ⟶ 700:
end program</lang>
=={{header|GAP}}==
<lang gap># Built-in function
DivisorsInt(Factorial(5));
# [ 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, 60, 120 ]
Line 1,398 ⟶ 1,399:
</lang>
Output :
<langpre> ?- factor(36, L).
L = [1,2,3,4,6,9,12,18,36].
 
Line 1,411 ⟶ 1,412:
 
?- factor(32767, L).
L = [1,7,31,151,217,1057,4681,32767].</pre>
 
</lang>
=={{header|PureBasic}}==
<lang PureBasic>Procedure PrintFactors(n)
Line 1,501:
factors(c(45, 53, 64))
</lang>
<langpre>
[[1]]
[1] 1 3 5 9 15 45
Line 1,508:
[[3]]
[1] 1 2 4 8 16 32 64
</langpre>
 
=={{header|REALbasic}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.