125k views
4 votes
50 pts

Look at the following assignment statements: word1 = "rain" word2 = "bow" What is the correct way to concatenate the strings? newWord = word1 == word2 newWord = word1 + word2 newWord = word1 * word2 newWord = word1 - word2

User Tomerar
by
4.6k points

2 Answers

4 votes

Answer:

I would do newWord = word1 * word2

Step-by-step explanation:

seems best for combining words. It wouldn't be - or == and + seems more math while * seems more combining words.

User TheGPWorx
by
4.3k points
1 vote

Answer:

newWord = word1 + word2

Step-by-step explanation:

Depends on the language you are using but typically to add two strings together you would use the + symbol

+ would be add text

- would be remove

* I've never seen to be honest

== would be says is equal to so figuring out if both word1 and word 2 were the same

User Sussan
by
5.1k points