Recursive Digit Sum

  • + 4 comments

    can u explain if the n is string how u are converting it in int

    • + 0 comments

      use function stoi( )

    • + 0 comments

      using ASCII, Since all numerical characters will be in series in ASCII table. eg. '9' - '0' = 9 and so on

    • + 0 comments

      using ASCII value like this : (int)s[i]-'0'