Ask Question
29 October, 23:55

What will be displayed after the following statements have been executed? int x = 15, y = 26, z = 32; x = x + 12; y = y/6; z - = 14; System. out. println (x = " + x + ", y = " + y + ", z = " + z);"

+1
Answers (1)
  1. 30 October, 02:45
    0
    Following are the output of the statements

    x = 27, y = 4, z = 18.

    Explanation:

    Following is the description of the statements.

    Initially, the variable x is initialized with 15, y is initialized with 26 and z is initialized with 32 The statement x=x+12 means adding the value of variable x by 12 and store in "x" variable so x=15+12=27 The y = y/6; statement gives the result 4 because the "/" operator gives the quotient. So 26/6 gives 4. z - = 14; statement gives the result 18 because it subtracts the value of z by 14 and stores in the "z" variable. Finally the System. out. println () method print the value of "x","y" and "z" variable
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What will be displayed after the following statements have been executed? int x = 15, y = 26, z = 32; x = x + 12; y = y/6; z - = 14; ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers