"+7" output should be 0 but it is 7. Why?


#1

the output of “+7” should be zero but it is showing 7.
is it not the wrong test case here?

Q3. If no numeric character is found before encountering garbage characters, what should I do?
A. Return 0.


#2

input ------------------------------------- Output
+7 Represents positive number -->| 7
-7 Represents negative number --> | 7
++7 invalid garbage value --> | 0
–7 invalid garbage value —> | 0
*7 invalid garbage value --> | 0