Answers for "how to add a digit to a numcer in c#"

C#
0

sum of digit of number c#

sum = 0;
while (n != 0) {
    sum += n % 10;
    n /= 10;
}
Posted by: Guest on April-25-2020
0

sum of digit of number c#

int result = 17463.ToString().Sum(c => Convert.ToInt32(c));
Posted by: Guest on January-04-2022

Code answers related to "how to add a digit to a numcer in c#"

C# Answers by Framework

Browse Popular Code Answers by Language