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

I neend help with this
Analytical SkillsC. Picture study: The picture shows a social evil.(i) What is the evil being shown?(ii) Which principle of the Preamble is being violatedhere?​
What Urbanization in Sub-Saharan Africa is _____. decreasing of little importance increasing stabilizing does the image of a “ferretlike face” suggest about Mr.
Draw a rough sketch of a quadrilateral KLMN. State, (a) two pairs of opposite sides, (b) two pairs of opposite angles, (c) two pairs of adjacent sides, (d) two
In a biconditional statement, the output is true if at least one input is true. -true -false
Famous ruler of gangas__________.​
Find the missing segment in the image below
why is human resource called active resource​
The terminal side of θ passes through the point (8,−7). What is the exact value of cosθ in simplified form?
Although she is not rich,she always wear.......clothes. a) respected b) respective c) respectful d) respect​