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
9.1k points

Related questions

1 answer
4 votes
52.1k views
asked Dec 19, 2020 16.3k views
Nimer asked Dec 19, 2020
by Nimer
8.5k points
1 answer
2 votes
16.3k views
1 answer
3 votes
58.1k views