C#: Assign same value to multiple variables in single statement

Is there any way (just out of curiosity because I came across multiple same-value assignments to multiple variables today) in C# to assign one value to multiple variables at once in a single statements?

Something along these lines (pseudocode):

int num1 = 1;
int num2 = 1;

num1 & num2 = 5;

Probably not but I thought it was worth asking in case something similar is actually possible!

11 Answers
11

Leave a Comment