Created
October 26, 2020 14:01
-
-
Save mgravell/c4f9590f72f9be4687bb188df2e01d2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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