Ask Question
25 June, 11:51

What is the output produced by the following lines of code? int value1 = 3; int value2 = 4; int result = 0; result = value1+ + * value2--; System. out. println ("Post increment/decrement: " + result); result = + +value1 * - -value2; System. out. println ("Pre increment/decrement: " + result);

+4
Answers (1)
  1. 25 June, 12:03
    0
    Output:

    Post increment/decrement: 12

    Pre increment/decrement: 10

    Explanation:

    In the above code that is written in the Java Programming Language.

    Set three integer variables and assign value in it "value1" to 3, "value2" to 3, "result" to 0. Increment in the variable "value1" by 1 i. e., 4 and multiply by decrement in the variable "value2" by 1 i. e., 3 and store their multiplication in the variable "result" i. e., 12. Print the value of the variable "result" with message. Again increment in the variable "value1" by 1 i. e., 5 and multiply by decrement in the variable "value2" by 1 i. e., 2 and store their multiplication in the variable "result" i. e., 10. Again print the value of the variable "result" with message.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is the output produced by the following lines of code? int value1 = 3; int value2 = 4; int result = 0; result = value1+ + * value2--; ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers