Ask Question
12 December, 08:42

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).

+2
Answers (1)
  1. 12 December, 09:03
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers