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

Camus said that the individual’s search for the meaning of life should lead to a path of ignoranceblissrighteousnessaction..
Which statement is true for one molecule of Sulfer trioxide
Witch one?? Due tomorrow
When she sampled a spoonful of hot soup, bekha burnt the tip of her tongue. during the 24 hours that followed the injury, bekha had difficulty detecting foods t
Which is not a health risk for binge-eating disorder? A yo-yo dieting B high blood pressure C death by starvation D diabetes
what chemicals made by glands help regulate growth, metabolism, stress, and reproduction?
Homeostasis is the regulation of an organism’s internal environment to maintain conditions suitable for life. Homeostasis requires A) competition between the bo
Now does a rubber rod become negatively charged through friction
Heeeeelllppppp pppllleeeaaaassseeee
A jet flew from new York to London in 7 hours the aravege speed was499.4miles an hour how many miles was the trip.