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 |
What is const keyword in c?
Mention four important string handling functions in c languages .
what is c++ programming?
Why doesnt long int work?
what is the function of pragma directive in c?
Give differences between - new and malloc() , delete and free() ?
#define swap1(a,b) a=a+b;b=a-b;a=a-b; main() { int x=5,y=10; swap1(x,y); printf("%d %d\n",x,y); swap2(x,y); printf("%d %d\n",x,y); } int swap2(int a,int b) { int temp; temp=a; b=a; a=temp; return; } what are the outputs?
Who had beaten up hooligan "CHAKULI" in his early college days?
Write a C program that reads a series of strings and prints only those ending in "ed"
Explain function pointer with exapmles.
1,1,5,17,61,217,?,?.
What are the types of unary operators?