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
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What is the difference between the expression “++a” and “a++”?
What is main () in c language?
When should we use pointers in a c program?
What is a void pointer in c?
Is there a built-in function in C that can be used for sorting data?
Tell us the use of fflush() function in c language?
Explain argument and its types.
What is the use of define in c?
What library is sizeof in c?
When do we get logical errors?
What are pointers really good for, anyway?
What is the process to generate random numbers in c programming language?
How was c created?
What is string function in c?