what is the result of "23"+"45"? Is it 2345 or 68? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is the result of "23"+"45"? Is it 2345 or 68?

6th Jan 2018, 2:33 PM
Tesneem Tarik Mohamed
Tesneem Tarik Mohamed - avatar
6 Answers
+ 5
in C++ languages if u summing a "strings" the answer is equal to 2345 if not the compiler calculate the sum of integers 23+45=68 so result is "23"+"45"=2345
6th Jan 2018, 3:04 PM
Youssef Ouamou
Youssef Ouamou - avatar
+ 4
This question will have different outputs I'm different languages so specify your language. in PHP it should be 68 js it should be 2345 soo..
6th Jan 2018, 2:42 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 3
If you are using c++ as it's specified in the quiestion, the only possible answer is 2345, because you are summing two strings, not integers.
6th Jan 2018, 2:43 PM
Groompel
Groompel - avatar
0
same with python, it'll give you 2345
6th Jan 2018, 4:07 PM
Brown
Brown - avatar
0
It will give you 2345 because python is weird GET HOPSCOTCH ITS SO FUNNNN
10th Jan 2018, 1:03 AM
SaDita
0
in Python it is considered as string and simply adds the two number (not algebric addition) .the answer will be 2345
10th Jan 2018, 8:50 AM
Yash Rastogi
Yash Rastogi - avatar