C- Floating Point Issues MCQ Questions and Answers
Practice ModeShowing 10 of 28 questions
Q1
What are the different types of real data type in C ?
Answer: Option C
Q2
What will you do to treat the constant 3.14 as a long double?
Answer: Option B
Q3
Which statement will you add in the following program to work it correctly?
#include<stdio.h>
int main()
{
printf("%f\n", log(36.0));
return 0;
}
Answer: Option B
Q4
We want to round off x, a float, to an int value, The correct way to do is
Answer: Option A
Q5
The binary equivalent of 5.375 is
Answer: Option B
Q6
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
Q7
What will you do to treat the constant 3.14 as a float?
Answer: Option B
Q8
Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ?
Answer: Option C
Q9
What is the primary reason for floating-point representation errors in computing?
Answer: Option B
Explanation: Binary systems cannot precisely represent all decimal fractions that terminate in base 10.
Q10
Which of the following decimal numbers can be represented exactly in binary floating-point format?
Answer: Option B
Explanation: Only numbers that are powers of 2 or sums of powers of 2 can be represented exactly in binary.