Skip to content

Instantly share code, notes, and snippets.

@mgravell
Created October 26, 2020 14:01
Show Gist options
  • Save mgravell/c4f9590f72f9be4687bb188df2e01d2d to your computer and use it in GitHub Desktop.
Save mgravell/c4f9590f72f9be4687bb188df2e01d2d to your computer and use it in GitHub Desktop.
using System;
class Program
{
static void Main()
{
int z = 42;
int x = Foo(z);
Console.WriteLine($"{x}, {z}");
// get: 871, 42
// expected: 871, 46
}
static int Foo(int j)
{
int result = 1;
for (int i = 0; i < 4; i++)
{
result += 5 * j++;
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment