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
What is main return c?
What are the advantages of using Unions?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
What is use of integral promotions in c?
How do shell structures work?
Which one would you prefer - a macro or a function?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
What are linked lists in c?
What is c language & why it is used?
how is the examination pattern?
What is string concatenation in c?
Explain how do you list files in a directory?
How many header files are in c?
What is a function simple definition?
write a program to print largest number of each row of a 2D array