MsBeautiful6250 MsBeautiful6250
  • 03-01-2021
  • Computers and Technology
contestada

What is the value stored at x, given the statements:

int x;
x=3/(int)(4.5+6.4)

a. 0.3
b. 0
c. .275229
d. 3.3
e. None of these

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 05-01-2021

Answer:

0.

Explanation:

Given

int x;

x=3/(int)(4.5+6.4)

Required

What is x?

The first line of the code segment declares x as integer. This means that, it will only hold non decimal numbers.

With the above explanation, options (a), (c) and (d) can not be true.

Solving further:

x=3/(int)(4.5+6.4)

The computer evaluates the denominator as:

x=3/(int)(10.9)

The denominator is then converted to an integer. So, we have:

x = 3/10;

3/10 = 0.3 but

Recall that: x will only hold non decimal numbers.

So:

x = 0;

Answer Link

Otras preguntas

the organelle involved in cell secretion is​
NEED HELP ON SECTION A FOR FRENCH !!!!!!!!!!
What is the value of tan 7pie/6
Estimate 78.8X6.8 I neep help
Some aquatic animals possess stinging cells. These cells are called: Hypothocysts. Nematocysts. Psoriacysts. None of the above.
______ involves separately and simultaneously sterilizing the food and its container before packaging the food.
The Fall of the Soviet Union marked the dissipation of this Communist power after the end of the Cold War. False True
help me please!! 10 points
A square storage unit has a volume of 607.5 ft3. The height of the unit is 7.5 ft. What are the length and width of the storage unit? length of 1 ft; width of 8
In the diagram below of triangle UVW, X is a midpoint of UV and Y is a midpoint of VW. If mZXYV = 7x + 21, and mZUWY = 91 – 7x, what is the measure of ZXY? V X