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..
Answers were Sorted based on User's Feedback
Answer / 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 |
How old is c programming language?
I have one doubt. What does below statement mean? #define sizeof(operator) where operator can be int or float etc. Does this statement meaningful and where it can be used?
write a program to find a given no. is divisible by 3 or not without using any arthimetic operators?
What does it mean when a pointer is used in an if statement?
What is a scope resolution operator in c?
What is difference between structure and union with example?
Why is c known as a mother language?
Sir i need notes for structure,functions,pointers in c language can you help me please
how to find turn around time in operating system?
We can draw a box in cprogram by using only one printf();& without using graphic.h header file?
Where is c used?
can any one provide me the notes of data structure for ignou cs-62 paper