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

Let H = (R+, x) be the group consisting of the set of all strictly positive real numbers with the binary operation given by multiplication. Show that H is isomo
How are sponges alive and living?
Calculate the average kind EE erage kinetic energy per molecule of CO2 when the gas is at glemperatus 50"C and pressure 2.00 atm. Molecular mass of CO2- 44
Members of the high school baseball team need to purchase cleats before the season starts. The pitcher paid $70 for his, but the second baseman found the same o
A sentence that includes an independent clause and at least one dependent clause is called a _____ sentence.
How did the three fifths please the southern states
Points A, B, C, and Q are _____.
The modern era came about, in part ,because of which historical event?
Which of the following is a prisoner reentry strategy?
what numbers go into 49 42 and 21