Ask Question
13 May, 06:35

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

+4
Answers (1)
  1. 13 May, 09:16
    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 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