52.1k views
4 votes
What is the output of inta= (int) 12.0 / 5 Systemoutprintln (a)

User Timbinous
by
7.1k points

1 Answer

0 votes

Answer:

Command: System.out.println (a)

Output: 2

Step-by-step explanation:

The output is going to be only the integer part of the division.

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

12/5 = 2 mod 2

The output is only the integer part. So

Command: System.out.println (a)

Output: 2

User Houssem
by
6.7k points