Vidyalelo
C# Programming · Q5

Operators and Expressions in C Sharp

Programming · C# Programming · question 5

Q5

Which of the following is the correct way to increment a variable by 1 in C#?

A.
++x;
B.
x += 1;
C.
x++;
Answer
D.
x = x + 1;

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board