Ask Question
7 November, 01:40

Assume the following variable definitions int a = 5, b = 12; double x = 3.4, z = 9.1. What are the values of the following expressions?

a) x * a.

b) static_cast (x) * static_cast (z).

c) static_cast (x * z).

d) static_cast (b).

+1
Answers (1)
  1. 7 November, 02:28
    0
    a) 17, b) 27, c) 30, d) 12

    Explanation:

    a) x * a

    3.4 * 5 = 17

    b) static_cast (x) * static_cast (z)

    Casting a value to int makes it an integer. The above one equals int (3.4) * int (9.1) = 3 * 9 = 27

    c) static_cast (x * z)

    Casting a value to int makes it an integer. The above one equals int (3.4 * 9.1) = int (30.94) = 30

    d) static_cast (b)

    12
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assume the following variable definitions int a = 5, b = 12; double x = 3.4, z = 9.1. What are the values of the following expressions? a) ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers