Ask Question
28 January, 16:33

What is the value stored at x, given the statements:

int x;

x = 3 / static_cast (4.5 + 6.4);

A.

.3

B.

0

C.

0275229

D.

3.3

+3
Answers (1)
  1. 28 January, 18:08
    0
    B. 0

    Explanation:

    The computation happens in the following sequence:

    1) The operands 4.5 and 6.4 are added : 4.5+6.4 = 10.9

    2) When this value is cast to int datatype, it becomes 10

    3) 3/10 = 0.3

    4) x in a variable of type int. So when a value of 0.3 is assigned to x, it is stored as 0.

    If we now display the value of x using printf or cout statement, we should expect to see 0 as the value printed on the console.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What is the value stored at x, given the statements: int x; x = 3 / static_cast (4.5 + 6.4); A. .3 B. 0 C. 0275229 D. 3.3 ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers