cataarbelaez3132 cataarbelaez3132
  • 23-08-2019
  • Computers and Technology
contestada

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

Respuesta :

Branta Branta
  • 25-08-2019

Answer:

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.

Answer Link

Otras preguntas

A box has a volume given by the trinomial x^3 5x^2 -24x What are the possible dimensions of the box? Given the volume, how to find the dimensions?
6 to the 2nd power ÷ 2 ( 3 ) + 4 =
Write the equation of the line that passes through the points (2,-4) and (-2,-2):
what is 95% of 600 ?
Which of the following describes the main reason the Spanish conquistadors needed Native American slaves?
Daniel, Emily and Thalia are attending an athletic camp this summer. They were told they had to monitor the amount of water they drink daily. The first day, Dan
How to graph y=|x+4|
Question 1 Compare neap and spring tides. Give two comparisons in your answer. Question 2 Which of the following best describes what causes the tides? The gravi
Which of the following lines is parallel to x=8? 3y=16 x=7 x=y y=8
Strong nationalism often hindered negotiations between world leaders. True False