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

what is 310,763,136 in word form
Which of the following is a strong electrolyte when it is mixed with water? (A) HNO₂ (B) KNO₃ (C) C₂H₅OH (D) CH₃COOH (E) NH₃
how is the flow of energy through a community different from the cycling from the matter?.
List each of the five themes of geography and explain how geographers use these themes to organize information about the earth.
Show how to count from 170 to 410 using tens and hundreds
what property is 19 + (11 + 37 ) ?
convert 6 4/5 to an improper fraction
A bus is moving at 24 m/a (t=0) slows at a rate of 4.0 m/s each second; how long does it take the bus to stop? and then how far does it travel while braking? I
LEAST COMMON MULTIPLE OF 27 , 48, 66
What was McDuffie's economic argument for slavery