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

Name any two points on a vertical line that is 4 units to the right of the y-axis
Can someone plz help me.
what is the difference between species name and species identifier
At the zoo,there were 3 times as many monkeys than lions.Tom counted a total of 24 monkeys and lions.How many monkeys were there?
Which process did the Founding Fathers implement to allow changes to be made to the U.S. Constitution? A. election B. primary C. referendum D. amendment
What were the major events that led to texas joining the union
Multiple Choice: A small amplitude transverse wave is travelling on a string. The frequency of the wave is suddenly doubled. Which one of the following is a tru
what is the maximum volume of 0.788M CaCl2 solution that can be prepared using 85.3g CaCl2
During World War II, Germany, Italy, and Japan were best known as Answer NATO. Allied forces. Axis Powers. 38th Parallel.
What are the answers to these questions Please help