sum of digits in c#
int num = 123;
int sum = 0;
while(num > 0)
{
sum += number % 10;
num /= 10;
}
Console.WriteLine(sum); // output: 6
Also in C#:
- devexpress objectspace to session
- stroke dash array wpf
- unity hide mouse
- fly cam extended script unity 3d
- c# string replace comma with newline
- c# region tag
- how to reduce garbage collection c#
- asp.net mvc return file
- file picker uwp c#
- check if multiple variables are null c#
- itext7 pdfwriter outputstream c#
- get normal from 3 points
- unity instantiate an object
- how to import datagridview to datatable in c#
- c# static review
- how to run csharp in visual studio code
- visual studio clear text script
- send type as argument c#
- how to change scenes in unity
- internal c#
- C# foreach loop async but wait at end
- unity how to change text in script
- split on uppercase c#
- disable button in android studio