Answer Posted / rajat bera
bool __inline is_integer(float f){
int i = f;
return (f == static_cast<float>(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;
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
how to construct a simulator keeping the logical boolean gates in c
What is static and volatile in c?
What is an expression?
Is there anything like an ifdef for typedefs?
Are there namespaces in c?
What are the advantages of union?
Why does not c have an exponentiation operator?
Why structure is used in c?
What are the differences between Structures and Arrays?
What is variable initialization and why is it important?
Explain how can I convert a string to a number?
What is structure data type in c?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What is an auto variable in c?
Write a program to generate random numbers in c?