Difficulty: Medium
Correct Answer: 2.6
Explanation:
Introduction / Context:
This problem exercises understanding of floating operations, truncation to integer, and reassignment in Pascal. TRUNC removes the fractional part (toward zero), which affects subsequent computations when we convert back to real and rescale.
Given Data / Assumptions:
Concept / Approach:
Follow the sequence carefully; TRUNC changes 26.3 to 26, and subsequent division by 10.0 yields 2.6, not the pre-TRUNC value. This is a classic rounding vs truncation illustration.
Step-by-Step Solution:
Verification / Alternative check:
If instead of TRUNC we had used ROUND, the result could become 2.6 or 2.63 depending on rounding behavior; here TRUNC explicitly removes the fractional part, confirming 2.6.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
int
range of −32768 to +32767)?
Discussion & Comments