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

There are approximately how many people in the world today? A. 1.5 billion B. 6.5 billion C. 3 billion D. 10 billion
why we develop corporations​
Explain how one physical property each of acid, base and sait is used by man​
Please help AND SHOW ALL THE WORK
who is Wintheodds1629 on Wattpad
Solve the inequality: 10x<2x+12
In Pennsylvania, what must trappers who wish to use cable restraint traps do? Demonstrate a need to use this type of trap rather than others. Practice first on
Which function has a greater rate of change?Function A:x 1.5 2.5 3.5 4.5 5.5y –5 0 5 10 15Function B:y = –4.5x + 15Function A has a rate of change of and Funct
¿En cuál periodo tiene la clase de historia mundial?
4. Cups and glasses are taking too long to air-dry. This could be cause by A. Incorrect timing of the wash cycle. B. An improper use of chemical sanitizer. C. T