answer will be -1 because the statement in while loop will never executed as (+(+0)!=0) this will be evaluated as false because zero is not equal to zero and i is decremented in here but decrementation is postfix uses the value first and decrement it after sequence point which is the condition point of while loop and hence the answer is -1
On Mon, Dec 13, 2010 at 8:15 PM, siva viknesh <[email protected]>wrote: > int main() > > { int i=0; > > while(+(+i--)!=0) > > i-=i++; > > printf("%d\n",i); > > return 0; } > > > (a) -1 (b) 1 (c) -65535 (d) 0 > > > Ans is option 'a' .. but how?? anybody help plz? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" 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/algogeeks?hl=en.
