Computer Science, asked by rajvirmohit, 9 months ago

What is the output of the Java code snippet? int a=5, b=10, c=15; a -= 3; b *= 2; c /= 5; System.out.println(a +" " + b + " " + c);

Answers

Answered by stargazer14
2

Answer:

a=a-3

a=5-3=2

b=b*2

b=10*2=20

c=c/5

c=15/5=3

output-

2 + 20 + 3

Answered by ashishks1912
0

Title:

Finding Output

Explanation:

  • 2 20 3 is the output of the following java program.
  • Initially the value of a is 5.
  • Initially the value of b is 10.
  • Initially the value of c is 15.
  • There are several command given in the program that perform specific task.
  • After every command in the program is executed the values of the variable a b and c is incremented or decremented.
  • Now the new values of a b and c are 2 20 and 3.
  • The last line in the given program helps to display the output of the program.
  • Thus the output of the program is 2 20 3.

Similar questions