19.8k views
2 votes
What ius the output of double a= (double) (12/5) Systenoutprintln (a)

1 Answer

1 vote

Answer:

Command: Systenoutprintln (a)

Output: 2.4

Step-by-step explanation:

The output is going to be the result of the division, since double variables work with decimal parts.

12 divided by 5 is integer part 2 with modulus 2. So

12/5 = 2 mod 2 = 2 + 2/5 = 2 + 0.4 = 2.4.

The output is the result.

So

Command: Systenoutprintln (a)

Output: 2.4

User Soyoes
by
8.0k points