2 Answers
New Answer3/20/2020 12:30:33 PM
Rajani Upadhyay2 Answers
New AnswerIncrement/decrement operators increase/decrease value of operand by 1 They are represented as. ++/-- but there is difference between placing them. e.g ++a and a++ are different. 1.Let,(pre-increment) int a=3; Console.Writeline(++a); //here output is 4 //after the above statement value of a becomes 4 2.Let,(post-increment) int a=8; Console.Writeline(a++); //here output is still 8 //after the above statement value of a becomes 9 Inshort, if the increment operator is before the operand then value increases by 1 on the same statement and when increment operator is after the operand increment take place but after that statement(in which it is incremented) Same is with decrement operator
Learn Playing. Play Learning
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message