code is running but sorting is not performed
Sorting is not performing
can you please explain me how convert to int is working
@anubhavb11
Your line
ans == ((s[i]-’\0’)*p);
What it should be
ans = ans + ((s[i]-‘0’)*p);
- == is boolean operator not assignment operator
- You need to add new digit so add it to ans using +
- You need to subtract ‘0’ not ‘\0’ null operator
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.