Skip to content

Instantly share code, notes, and snippets.

@h4r7w3l1
Created March 19, 2021 11:32
Show Gist options
  • Save h4r7w3l1/b974678c7d5e75ef3716704819d53639 to your computer and use it in GitHub Desktop.
Save h4r7w3l1/b974678c7d5e75ef3716704819d53639 to your computer and use it in GitHub Desktop.
List<int> numList = new List<int>{1, 2, 4, 5, 12, 55};
int theSum = 0;
foreach(int i in numList)
{
theSum = theSum + i;
System.Console.WriteLine($"{i.ToString()} > {theSum.ToString()}");
}
System.Console.WriteLine("Total: "+theSum.ToString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment