Which of the following is the correct way to increment a variable by 1 in C#?
A. ++x;
B. x += 1;
C. x++;
D. x = x + 1;
Answer: Option C
Related Questions on Operators and Expressions in C Sharp
What does the modulus operator (%) do in C#?
A. Increments the operand by 1
B. Returns the quotient of a division
C. Performs multiplication
D. Returns the remainder of a division
Join The Discussion