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

What is the declaration of independence?
If f(x) = 3x + 2 and g(x) = 2x – 2, what is (f – g)(x)?
Which measure is less than 435 inches? A 37 ft B 36 ft 10 C 12 yd 3 in. D 12 ft 3 in.
what is direct variation?
sentence with unkind
What was the goal of the WSPU in Britain?
A large giraffe eats 34 kilograms of leaves and twigs each day. How many kilograms of leaves and twigs would 17 large giraffes eat in a day?
What was the goal of the WSPU in Britain?
The lowest temperature on a winter morning was –8°F. Later that same day the temperature reached a high of 24°F. By how many degrees Fahrenheit did the temperat
Solve the problem by using the counting principle. (: Drapery is sold in 4 different fabrics. Each fabric comes in 13 different patterns. Each pattern is off