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 |
can you change name of main()?how?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
Give a fast way to multiply a number by 7
15 Answers Accenture, Aricent, Microsoft,
What is the use of #include in c?
What is the use of getchar functions?
i want explaination about the program and its stack reprasetaion fibbo(int n) { if(n==1 or n==0) return n; else return fibbo(n-1)+fibbo(n-2); } main() { fibbo(6); }
Is int a keyword in c?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
What is union and structure in c?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5
What is the value of y in the following code? x=7;y=0; if(x=6) y=7; else y=1;