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

Three-quarters of the elements are..
Consider the model of the food chain. Imagine a local farm has dumped excess pesticides in the pond used for irrigation. This will impact the food chain in
A seed with high levels of ABA will require______ before it will germinate A. Water B. Stratification C. Quiescence D. Scarification
Tensions rose between Britain and the colonies when the _____ left Crispus Attucks and four others dead.
I need help with this question​
This number is three tenths less than twenty-four and twenty hundredths
Determine which of the following sets of data satisfy the first law of thermodynamics? (Recall that E = total energy = U + KE + PE). a. W = 50 kJ Q = 170 kJ Del
Which of the following is the correct scientific notation for 0.000468
209 tickets were sold for the school play.The cost of admission was $3.50 per pet. How much money was collected for the play?
Which explains why Supreme Court justices are given lifetime appointments?