I have an integer value (ex: 723) and i want to add up all the values in this integer until i get a single value.
ex: 7 + 2 + 3 = 12
1 + 2 = 3
I’m new to C#. please give me a good explanation of your answer as well 🙂
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
% 10gives the final digit each time, so we add that into an accumulator./= 10performs integer division, essentially removing the final digit each time. Then we repeat until we have a small enough number.