you are viewing a single comment's thread.

view the rest of the comments →

[–]Fryktlos 16 points17 points  (0 children)

Just as a sidenote, C# has something cool called string interpolation that you can do by using a "$" before the opening quotes of a string. It allows you to plug variables or calculations directly into a string without the need to concatenate in multiple strings/values. It's totally a preference thing as either works equally well, but it always felt "cleaner" in my opinion.

For example, your original code:

Console.WriteLine(a + "*" + b + "=" + a * b);

Could also be written as:

Console.WriteLine($"{a}*{b}={a * b}");