Do you have a problem with the math involved or the C++ involved? The easiest way to do the math you need using C++ is to use the modulo operator. Assuming m and n are both postive integers, if the result of m % n is zero then, n is a positive proper divisor of m according to the description you provided.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005