Thread
:
Finding divisors
View Single Post
Jan 7th, 2007, 7:34 PM
#
15
The Dark
Expert Programmer
Join Date: Jun 2005
Posts: 882
Rep Power:
4
(
Toggle Plain Text
)
for ( int i = 2; i <= n; i++ )
for ( int i = 2; i <= n; i++ )
You should use n/2 for the upper limit (as you did in your first post). Anything bigger than n/2 is not going to be a divisor of n.
The Dark
View Public Profile
Find More Posts by The Dark