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

Write the quadratic equation whose roots are-1 and 6, and whose leading coefficient is 4 (Use the letter to represent the variable.)?=0
Can anyone help me solve this algebra porblem? -4 2/3=2n/3+1/3+n/3 Negative four and two thirds equals two "n" over three plus one over three plus "n" over thre
write short notes on military dictatorship in Chile
In the given figure , if angel ROQ = 90 and angel POS : angel ROS = 4 : 5 , then the value of angel SOQ is
what is a subspecies?
if a line passes through the point (1,9) and has a slope of 6 , write it as an equation
“What does it mean when we “rework” copyrighted material?”
did dinosaurs really have brains in their tails?
For which system of equations is (2, 2) a solution? A.–3x + 3y = 0x + 6y = 10B.–2x + 5y = –64x – 2y = 4C.5x – 2y = –63x – 4y = 2D.2x + 3y = 104x + 5y = 18
Why do People Tell Actors to Break a Leg?