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...

Write a programm such that
if user enter 11.25 it roundup to 11
but if user enter 11.51 upto 11.99 it will round up to 12
i.e.;convert the floting point value into integer format as
explain above..

Answer Posted / gsrinivas

#include<sdtio.h>
#include<math.h>
void main()
{
float x;
int y;
printf("\n entere the no");
scanf("%f",&x);
y=ceil(x);
y=floor(x);
printf("\n %d",y);
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can variables be declared anywhere in c?

1097


What is a const pointer?

1134


How do you use a pointer to a function?

1093


Explain how do you convert strings to numbers in c?

1084


Tell us something about keyword 'auto'.

1077


What is array of structure in c?

1190


How can I manipulate individual bits?

1050


Why do we use header files in c?

1084


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1327


In which language linux is written?

1236


C language questions for civil engineering

1724


How does struct work in c?

1097


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1289


How can I do graphics in c?

1039


What are the scope of static variables?

1197