I've been studying C programming again with the usage of my "C How to Program" textbook. As an exercise within the text, I have been prompted to find the smallest divisor of a number supplied by a user. Just to clarify, just in case, a number is a divisor if the division results in a remainder of 0, and we are looking for a divisor greater than 1. To complete this, it instructs that I should use a while-loop. I have just begun using while-loops, so I understand the basic idea and function, but not exactly how to execute everything properly in this situation. Seeing this example will grant me a better understanding. I take it as that I am supposed to create some code that looks for a divisor, counting up until it finds one. Thank you for any help that you provide. It is greatly appreicated.
Best regards!