Checking if value is float or int

I want to create a program that will find the factors of a given number.
I have thought up of this concept:
The User will enter a value (say x).
The program will divide the number by 2 then 3, than 4 ... (until x/2)
The program will then publish all the values that were whole numbers.

Now I wanted help with two things:
1. How do I make the program see that whether the value is int or float?
2. How do I make the program publish the values that returned the int value?

Thanks in advance
C++ is statically typed, so you always know the type of your variables and expressions. Though I understand that's not what you were asking about.

When a and b are integers, a is divisible by b, if a%b == 0.
Sorry, It somehow got redundant. The other one (the one that was solved) is here:http://www.cplusplus.com/forum/general/41273/
Topic archived. No new replies allowed.