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 2 ways to dress like a Frenchman.
please help it will mean alot
Which of the following is NOT produced during glycolysis? pyruvic acid glucose ATP NADH
I need help and show steps
some_______ kill bacteria by attacking the cell wall of the bacteria.
What are the odds of rolling two number cubes and getting a sum of eight?
Which of these was a result of the Great Depression? A) the elimination of the American business cycle B) the reduction of the power of the Democratic party
Gary is examining an organism. Which of the following characteristics would indicate that the organism belongs in the kingdom Animalia?
Find the value of the variables in the following polygon. please explain
When using ________ financing, the company incurs a legal obligation to repay the amount borrowed?