manish; i = 3; i = i++ + i--; //in this case i=6 since i++ equals 4 and i-- equals 2
On 6/8/10, Manish kumar Singh <[email protected]> wrote: > Can any one explain what will be the value of 'i' after the statement > i = 3; > i = i++ + i--; > > both in C++ and Java. > > On 6/8/10, cornerstone <[email protected]> wrote: >> "So, the effect of the "++" is applied >>> BEFORE the effect of the assignment" >> dude it is not lyk dat post increment operator increments the d value >> after the statement is executed and the complete statement ends after >> dat semicolon here n here d statement is n=n++; >> so the thing is dat the value of n is not incremented bfore d >> execution of the whole statement is over.(as yew hav done in ur >> explanation) >> n=10;//ok >> n=n++;//n holds now a value of 10 during the execution of this >> statement and 11 after the execution of this statement >> >> -- >> You received this message because you are subscribed to the Google Groups >> "google-codejam" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/google-code?hl=en. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "google-codejam" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > > -- me: frank kavakure mail-me : [email protected] | [email protected] call-me: (+257) 78-589-552 | 79-589-552 | 75-137-437 skype-me: franqxx view-me: http://franqxx.appspot.com I am currently waving on google: [email protected] -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
