Which of the following expressions will yield 0.5?

a. 1 / 2
b. 1.0 / 2
c. (double) (1 / 2)
d. (double) 1 / 2
e. 1 / 2.0

bde 1 / 2 is an integer division, which results in 0.

Computer Science & Information Technology

You might also like to view...

When you power down your computer, Windows first closes all open programs, installs updates, if any are needed, then closes Windows and turns off the computer

Indicate whether the statement is true or false

Computer Science & Information Technology

There are ________ options for controlling navigation in sway

A) two B) four C) six D) three

Computer Science & Information Technology