I know how to validate input, but how can I check if

Code:
int ans = num1 / num2; // all integers
is an integer and not a float?