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
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What is ambagious result in C? explain with an example.
What is dynamic memory allocation?
What is chain pointer in c?
What is use of integral promotions in c?
Explain what is the benefit of using const for declaring constants?
What is strcmp in c?
Explain how can a program be made to print the line number where an error occurs?
What is the right type to use for boolean values in c? Is there a standard type?
Explain the use of #pragma exit?
Why isnt there a numbered, multi-level break statement to break out
What are the 4 data types?
What are the main characteristics of c language describe the structure of ac program?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
why return type of main is not necessary in linux