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 |
Explain how can I open a file so that other programs can update it at the same time?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
can u suggest me am in a confusion to choose whether to go to c programming or a software testing . am a graduate in B.sc(electronics).
What oops means?
Why doesn't the code "a[i] = i++;" work?
how can i make a program with this kind of output.. Enter a number: 5 0 01 012 0123 01234 012345 01234 0123 012 01 0
Explain what is the difference between #include and #include 'file' ?
I need previous papers of CSC.......plz help out by posting them.......
What is calloc in c?
write a recursive program in'c'to find whether a given five digit number is a palindrome or not
When should we use pointers in a c program?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above