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

b. 1.0 / 2
d. (double) 1 / 2
e. 1 / 2.0
1 / 2 is an integer division, which results in 0.

Computer Science & Information Technology

You might also like to view...

You are required to add a second memory module to a laptop. You open the hatch on the bottom of the laptop to reveal only a single memory module installed to the only slot. Where should you look for second memory slot?

a. Behind the removable hard drive b. Underneath the keyboard c. Under the battery d. Behind the DVD-ROM drive

Computer Science & Information Technology

The _____ of a sound relates to the sound intensity or loudness.

A. amplitude B. frequency C. sampling rate D. bit depth E. dynamic range

Computer Science & Information Technology