Complete the code to assign the value 10 to the variable number.
int number [1] 10;
The single equal sign = is used to assign a value to a variable in C#.
Complete the code to add 5 to the variable score using a compound assignment operator.
score [1] 5;
The += operator adds the right value to the variable and assigns the result back to it.
Fix the error in the code to multiply count by 3 using a compound assignment.
count [1] 3;
The *= operator multiplies the variable by the value and assigns the result back to it.
Complete the code: first initialize value to 2, then subtract 2 from it using a compound assignment operator.
value [1] 2; value [2] 2;
First, we assign the value 2 to value using =. Then, we subtract 2 from value using the compound assignment -=.
Fill all three blanks to add each word to the dictionary `lengths` mapping it to its length, but only if the length is greater than 3. Assume `word` is a string variable in scope.
var lengths = new Dictionary<string, int>(); if ([1] > 3) { lengths[[2]] = [3]; }
word for keys.word.Length and using a string literal.Check if word.Length > 3. If so, set lengths[word] = word.Length.