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

Choose one of the advantages you would have had as a trader living in a seaport. A) Your camels could be close to fresh water. B) Your family would be
if anyone could help me answer please do!
HELP MEZZZZZZZ PLEASE
The post-exposure exam follow-up must include counseling about the possible implications of the exposure and your infection status, including the results and in
Una ________ es lo que recipes del doctor.receta <--- is your answer. resfríoherida
Need help with this question
how would you solve this problem 2/6×3= would you divide or multiply
A cylinder with a moving piston expands from an initial volume of 0.250 L against an external pressure of 3.00 atm . The expansion does 235 J of work on the sur
Which of the following statements are true about inverse matrices? All square matrices have inverses. If A and B are inverse matrices, then A and B must be squa
My maths problems is it right not sure if I did it right. Thanks