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 difference between arrays and pointers?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
How are 16- and 32-bit numbers stored?
What is the use of putchar function?
What is this infamous null pointer, anyway?
Which header file is essential for using strcmp function?
What is substring in c?
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
Write a program to know whether the input number is an armstrong number.
How do you generate random numbers in C?
What are formal parameters?
What is a double c?
What is the right type to use for boolean values in c? Is there a standard type?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
How arrays can be passed to a user defined function