خرید بک لینک

Vote count: 0

++aValue is the same as: 1 + aValue and aValue++ is the same as: aValue + 1. both should result in number 2 (if aValue is 1).

this code will produce 2 :

int aValue = 1; do { aValue++;

            Console.WriteLine(aValue++);

        }
        while (aValue < 3);

        Console.ReadKey();
    }

while this code will produce 3:

 int aValue = 1;

      do
        {
            aValue++;

            Console.WriteLine(++aValue);

        }
        while (aValue < 3);

        Console.ReadKey();
    }

How come both codes don't produce the same results?

Thank you.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 13 تير 1395 ساعت: 3:27

صفحه بندی