Sorting is not performing

code is running but sorting is not performed

Hey @anubhavb11


I’ve mentioned your errors in this in comments

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);

  1. == is boolean operator not assignment operator
  2. You need to add new digit so add it to ans using +
  3. 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.