Why the answer is 0? | SoloLearn: Learn to code for FREE!


Why the answer is 0?

It's a challenge question and found answer 0 but don't know how. Can anyone please explain? Check the attached Screenshot. https://photos.app.goo.gl/oE8XPESjPi7kcP539


8/4/2020 4:40:35 PM


4 Answers

New Answer


In echo statement you can not use plus sign to join two strings.


To concatenate we use '.' symbol'+' is for numbers. Here string as a number is zero. Adding two strings is 0 + 0=0


Thanks everyone I got now.


AJ #L1G3 string concatenate is done by dot operator so that's why non numeric value is provided it's parses error. Due to that to make it more good the author of that quiz has used 0 as error 1 as executed.