Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to find that no is int or float?

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


Please Help Members By Posting Answers For Below Questions

disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2108


What is ambagious result in C? explain with an example.

2695


What is dynamic memory allocation?

1388


What is chain pointer in c?

1114


What is use of integral promotions in c?

1207


Explain what is the benefit of using const for declaring constants?

1087


What is strcmp in c?

1213


Explain how can a program be made to print the line number where an error occurs?

1282


What is the right type to use for boolean values in c? Is there a standard type?

1060


Explain the use of #pragma exit?

1216


Why isnt there a numbered, multi-level break statement to break out

1099


What are the 4 data types?

1058


What are the main characteristics of c language describe the structure of ac program?

1264


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?

2139


why return type of main is not necessary in linux

2151