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

joe has $4 more than Hector. Hector has $8 more than Tami. If Tami has $x, write an expression for the amount of money Joe has.​
20 POINTS ANSWER ASAP BRAINLIEST GIVEN answer question 2 a and b i and ii. The diagram shows a six sided shape. All the measurements are in cm. The area of the
Some one knows how to do it?
During the D-Day landings, which invading forces met the greatest resistance? the British at Sword the Germans at Juno the Americans at Omaha the Soviets at Uta
6. (a) The formula for the nth term of the sequence 2, 15, 48, 110, 210, ...n(n+1)(3n-1)2Find the 9th term.​
What the approximate location of Cairo, Egypt, using latitude and longitude
What is indirect development?
What words is a synonym of treaded OA. traveled SETEMBRE B. detached C. surrendered OD. repelled
what are some exceptions to search without a warrant​
Which of the following elements would most likely form an ion with a +2 charge?Si.C.Mg.Na.P.