The objective is to divide the number by 3 and not just check for it's divisibility. Adding the digits using itoa() and then repeated subtraction will check for it's divisibility by 3 and not give us the quotient. To get that you will have to carry out repeated subtraction on the number anyway. So whats the point?
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/BWTzYtcBhIgJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.