| 1. | Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ? |
|||||||
Answer: Option C Explanation: fmod(x,y) - Calculates x modulo y, the remainder of x/y. Example:
Output: |
| 2. | What will you do to treat the constant 3.14 as a float? |
|||||||
Answer: Option B Explanation: Given 3.14 is a double constant. |
| 3. | A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored? |
|||||||
Answer: Option D Explanation: No answer description available for this question. Let us discuss.
|
| 4. | The binary equivalent of 5.375 is |
|||||||
Answer: Option B Explanation: No answer description available for this question. Let us discuss.
|
| 5. | We want to round off x, a float, to an int value, The correct way to do is
|
|||||||
Answer: Option A Explanation: Rounding off a value means replacing it by a nearest value that is approximately equal or smaller or greater to the given number. y = (int)(x + 0.5); here x is any float value. To roundoff, we have to typecast the value of x by using (int) Example:
Output: |
| 6. | Which statement will you add in the following program to work it correctly? #include<stdio.h> |
|||||||
Answer: Option B Explanation: math.h is a header file in the standard library of C programming language designed for basic mathematical operations. Declaration syntax: double log(double); |
| 7. | Which of the following range is a valid long double (Turbo C in 16 bit DOS OS) ?
|
|||||||
Answer: Option A Explanation: The range of long double is 3.4E-4932 to 1.1E+4932 |
| 8. | If the binary eauivalent of 5.375 in normalised form is 0100 0000 1010 1100 0000 0000 0000 0000, what will be the output of the program (on intel machine)? |
|||||||
Answer: Option C Explanation: No answer description available for this question. Let us discuss.
|
