hi..
In the c-programming ...
suppose i =10;
i=i++;
The above statement will result that i is incremented by 1, the value of I is 11.
but,.. In the c# the value Of i is remain the same 10..
why?
Plz reply
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kunal VaishyaRank #990 · 2K reputationPosted Apr 17, 2012, 8:46 PM EDT
No need to assign a vlue in same variable when you increment any value
if you use like this
Suppose
i =10;
i++;
you will be get 11 value 0f i
in c# it increment value after assigning thats why you get old value .
Kunal VaishyaRank #990 · 2K reputationPosted Apr 17, 2012, 8:48 PM EDT
i=10 ;
i = ++i ;
you will get 11
VulpesRank #55 · 29.2K reputationPosted Apr 18, 2012, 2:10 AM EDT