Horje
sum of digits in c# Code Example
sum of digits in c#
int num = 123;
int sum = 0;
while(num > 0)
{
  sum += number % 10;
  num /= 10;
}
Console.WriteLine(sum); // output: 6
sum the digits in c#
sum = 0;
while (n != 0) {
    sum += n % 10;
    n /= 10;
}
sum of digit of number c#
int result = 17463.ToString().Sum(c => Convert.ToInt32(c));




Csharp

Related
c# get binary array from int Code Example c# get binary array from int Code Example
c# convert list to string Code Example c# convert list to string Code Example
get unix time in seconds C# Code Example get unix time in seconds C# Code Example
c# how to run external program Code Example c# how to run external program Code Example
c# format string with 2 decimals Code Example c# format string with 2 decimals Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7