What are the assignment expressions in C# programming language?

 Posted by Goud.Kv on 9/3/2014 | Category: C# Interview questions | Views: 1851 | Points: 40
Answer:

Assignment expressions store the result to a variable after performing operation.
In other words, they assign the value (after the action) to a variable by using '=' operator.

Example,
int x = 5;  // Assignment Expression : x = 5

x = x + 10; // Assignment Expression : x = 15
In the above example, we are assigning value to 'x'.
Also adding another value (10) and storing it back to 'x'.


Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response