How to check whether input value is integer or float?
How about this. using the modulo operator
if(a%b==0)
{
System.out.println("b is a factor of a. i.e. the result of a/b is going to be an integer");
}
else
{
System.out.println("b is NOT a factor of a");
}
You should check that fractional part of the number is 0. Use
x==Math.ceil(x)
or
x==Math.round(x)
or something like that