Ask Question

What is the output of the following statement?

System. out. println ("1 + 2/n"

+ "3 - 4/n" + "=/n" + (1 + 2)

+ "/n" + (3 + 4));

+4
Answers (1)
  1. 16 December, 04:38
    0
    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)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is the output of the following statement? System. out. println ("1 + 2/n" + "3 - 4/n" + "=/n" + (1 + 2) + "/n" + (3 + 4)); ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers