102k views
3 votes
What is the output of int a= 12 / 6*2. Systemoutprintln (a)

1 Answer

4 votes

Answer:

This code will produce

4

Step-by-step explanation:

In this code the result of the arithmetic operation is stored in the variable a.On evaluating the expression it first divides 12 by 6 which results in 2.Then the result is multiplied by 2.Which results in 4 and it is stored in a.Then it is printed on the screen using print statement.

Hence the answer is 4.

User Rishin S Babu
by
6.1k points