String comparison

why are we gettting 12 or -12 as output when comparing two strings?

@priyeshant1104 hey string compare function can return 0,negative and positive number ,if it return 0 than both string are equal else not equal ,so ye kuch bhi return kr skta hai whether positive or negative .

I am asking why it returns 12 or -12 and not any other number(s)?

@priyeshant1104 bhai abhi is waqt woh 12 return krha hai jaroori thodi hai ki woh koi aur no hi print kre 12 krrha abhi woh is string me,hme +ve or -ve se mtlb hai na ki value se.Hope you get it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.