Wanted to know if I could get a little help with an assignment.

I have to create a program that can guess the factors of a number.

From what I figure If i can divide X (The number to be factored) by Y evenly then I have figured out the factors. The problem is I have no idea how to test for a whole number. Because I could have a loop increment Y each time until Z is a whole number. Wondered if anyone had an idea of how to test this. I tried a few things, and came up short.

Any help would be appreciated.