Question { 8041 }
how to find that no is int or float?
Answer
bool __inline is_integer(float f){
int i = f;
return (f == static_cast
(i));
}
int main()
{
int num=0;
double num2= 1234;
num=num2;
if(is_integer(num2))
printf("the number is int");
else
printf("the number is float");
getch();
return 0;
}