Limited access

The following code segment outputs 13/5 = 2.0

 double answer = 13/5;


The programmer intends that it should print 13/5 = 2.6.

Which of the following changes to the first line of code will NOT fix the problem?

A

Casting 13 to a double (i.e. (double)13))

B

Writing 13 in floating-point notation (i.e. 13.0)

C

Casting 5 to a double (i.e. (double)5))

D

Writing 5 in floating point notation (i.e. 5.0)

E

Writing : double answer = (double)(13/5);

Select an assignment template