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

What is meant by controlled experiment
A to the 3rd +c to the 2nd - 3b if a=-4 b=6 and c=-9
1. An arrow is shot with an initial velocity of 60.0 m/s at an angle of 30.0° above the horizontal. What is the maximum height it will reach? a. 23 m b. 46 m c.
Draw the structure of 2,4,4,5-tetramethyl-2-hexene.
Wnite in scientific notation: 254.000​
Describe Augustus from the fault in our stars
Select the appropriate response. An isosceles triangle has vertices at (1,1) and (3, 3). Which of the following could be the coordinates of the third vertex? A.
Find the equation of the tangent line to the curve at the given point? y = x cot(x) at the point with x-coordinate= π/4
The goal of ________ is to inform and remind people in a target market about specific products, eventually persuading them to participate in an exchange. Group
PLEASE HELP IM TRYING TO CATCH UP!!!!!!!!!!!!!!!!!!!!!!!!!!