Kowalaholic
Kowalaholic Kowalaholic
  • 23-01-2020
  • Computers and Technology
contestada

What is the output of the following statement?
System.out.println("1 + 2\n"
+ "3 - 4\n" + "=\n" + (1 + 2)
+ "\n" + (3 + 4));

Respuesta :

Aalsharaphy
Aalsharaphy Aalsharaphy
  • 26-01-2020

Answer:

1 + 2

3 - 4

=

3

7

Explanation:

1 + 2 (it print the string "1+2" and goes to a new line

3 - 4 (it print the string "3-4" and goes to a new line)

= (it print the string "=" and goes to a new line)

3 (it perform arithmetic operation on 1+2 to give 3)

( It create empty new line)

7. (it perform arithmetic operation on 3+4 to give 7)

Answer Link

Otras preguntas

Janelle's doctor warned her that she has extremely high blood pressure, which can lead to a variety of dangerous health problems. Which of the following should
What did the Missouri Compromise propose, and what was the result?
The only way for politics to affect government is through elections true or false?
Find the product. (y2 - 3)(y4 - 6y2 + 9)
Where did Columbus believe he had arrived when he first sailed to the Americas? Select the best answer from the choices provided. Brazil Africa India Newfoundla
Instead of terminating the series, the producers decided to extend it for an additional season. In the sentence above, which of the following strategies would b
Which one of the following drinks would be the top choice for potassium content? A. Chocolate milk B. Low-fat milk C. Juice D. Water
show answer in lowest terms. 3 1/4 - 1 3/16=
Name the 3 events that make up the equestrian sport eventing.
What is the solution of the system? Use substitution. 3x + 2y = 7 y = –3x + 11 a. (6, -3) b. (6, -7) c. (-4 19/2) d. (5, -4)