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
Can variables be declared anywhere in c?
What is a const pointer?
How do you use a pointer to a function?
Explain how do you convert strings to numbers in c?
Tell us something about keyword 'auto'.
What is array of structure in c?
How can I manipulate individual bits?
Why do we use header files in c?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
In which language linux is written?
C language questions for civil engineering
How does struct work in c?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
How can I do graphics in c?
What are the scope of static variables?