1. Floating point representations in computers are exact, and are not prone to small floating point inaccuracies.
True
False
2.
The difference between a declared variable and a declared constant is that a constant’s value can vary at run-time, but a declared variable’s value cannot ever be changed after it is initialized
True
False
3.
The expression:
72 > 116 || 27 > 15
evaluates at run-time to true.
True
False
4.
The expression:
4 > 8 && 2 < 2 * 1
evaluates at run-time to false.
True
False
5.
The expression:
7 + 1 >= 8 && 12 < 2 * 6
evaluates at run-time to true.
True
False
Question 1:
Floating-point representations in computers are exact and are not
prone to small floating-point inaccuracies.
Ans: False
It is not true that the floating-point representations in the computer are exact. The precision is not accurate, a floating-point value is APPROXIMATELY equal to 16 significant decimal digits.
Question 2:
The difference between a declared variable and a declared constant
is that a constant’s value can vary at run-time, but a declared
variable’s value cannot ever be changed after it is
initialized
Ans: False
Once we define a variable as constant, we can change its value either in the program or during run-time whereas the declared variable value might change anywhere anytime in the program.
Question 3:
The expression:
72 > 116 || 27 > 15 evaluates at run-time to true.
Ans: True
Take the expression: 72 > 116 || 27 > 15
72>116 is false and 27>15 is true. for Logical OR any one of
the statements is true then the result is true.
Question 4:
The expression: 4 > 8 && 2 < 2 * 1 evaluates at
run-time to false.
Ans: True
Take the expression: 4 > 8 && 2 < 2 * 1
4>8 is false and 2>2 is also false. for Logical AND any one
of the statements is false then the result is false.
Question 5:
The expression: 7 + 1 >= 8 && 12 < 2 * 6 evaluates at
run-time to true.
Ans: False
Take the expression: 7 + 1 >= 8 && 12 < 2 *
6
8>=8 is true and 12<12 is false. for Logical AND any one of
the statements is false then the result is false.
(Feel free to drop me a comment, If you need any help)
Hope this Helps!!!
Please upvote as well, If you got the answer?
If not please comment, I will Help you with that...
Get Answers For Free
Most questions answered within 1 hours.