Re: [algogeeks] affect of change

2011-08-31 Thread Guneesh Paul Singh
the value of d expression i++ is a integer constant.so u cant assign to a value 20 to it same is d case if u execute (i++)++; On 8/30/11, rahul vatsa wrote: > @nidhi, if u change the i++ to ++i in D, it will compile, bt off course it > will keep on printing 20 in an infinite loop. > > i just

Re: [algogeeks] affect of change

2011-08-30 Thread rahul vatsa
@nidhi, if u change the i++ to ++i in D, it will compile, bt off course it will keep on printing 20 in an infinite loop. i just tried it, nd it compiles. invalid lvalue in assignment will be when it is i++. On Tue, Aug 30, 2011 at 1:06 PM, nidhi jain wrote: > > > @rahul: it is still giving an

Re: [algogeeks] affect of change

2011-08-30 Thread nidhi jain
@rahul: it is still giving an error (invalid lvalue in assignment). -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsu

Re: [algogeeks] affect of change

2011-08-30 Thread annarao kataru
i think both c and d will be affected @tech coder can u plz explain why d gives error. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send

Re: [algogeeks] affect of change

2011-08-30 Thread tech coder
oh yes d will give error. On Tue, Aug 30, 2011 at 9:36 AM, tech coder wrote: > c and d will be affected. > > > On Tue, Aug 30, 2011 at 8:51 AM, nidhi jain wrote: > >> >> >> yes, D vl give an error ,as increment operator cannot be used as lvalue >> for assignment. >> >> NIDHI JAIN >> INFORMATION

Re: [algogeeks] affect of change

2011-08-30 Thread tech coder
c and d will be affected. On Tue, Aug 30, 2011 at 8:51 AM, nidhi jain wrote: > > > yes, D vl give an error ,as increment operator cannot be used as lvalue for > assignment. > > NIDHI JAIN > INFORMATION TECHNOLOGY(FINAL YEAR) > NIT,DURGAPUR > > -- > You received this message because you are subsc

Re: [algogeeks] affect of change

2011-08-30 Thread rahul vatsa
(A) i = 20; i++; (B) for (i = 0; i<20; i++) { } (C) a = i++; (D) while (i++ = 20) cout < 20 a = ++i -> 21 D. -- i++ returns a const int value, so its not a lvalue nd hence cant be on lhs of = ++i returns a reference of int object, nd so is an lvalue nd hence can be on lhs of =., so

Re: [algogeeks] affect of change

2011-08-30 Thread nidhi jain
yes, D vl give an error ,as increment operator cannot be used as lvalue for assignment. NIDHI JAIN INFORMATION TECHNOLOGY(FINAL YEAR) NIT,DURGAPUR -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks

Re: [algogeeks] affect of change

2011-08-30 Thread bagaria.ka...@gmail.com
i blv only c d will give an error ? On Tue, Aug 30, 2011 at 8:53 PM, kARTHIK R wrote: > Yeah, only c and d gets affected. > On Aug 30, 2011 8:38 PM, "Piyush Grover" > wrote: > > I think, it should be C & D; > > a = i++ => a=i; i = i+1; > > a = ++i; => i = i+1; a = i; > > > > in similar fashion,

Re: [algogeeks] affect of change

2011-08-30 Thread kARTHIK R
Yeah, only c and d gets affected. On Aug 30, 2011 8:38 PM, "Piyush Grover" wrote: > I think, it should be C & D; > a = i++ => a=i; i = i+1; > a = ++i; => i = i+1; a = i; > > in similar fashion, D gets affected. > > @ Raj...how come?? > > On Tue, Aug 30, 2011 at 8:11 PM, raj kumar wrote: > >> code

Re: [algogeeks] affect of change

2011-08-30 Thread Piyush Grover
I think, it should be C & D; a = i++ => a=i; i = i+1; a = ++i; => i = i+1; a = i; in similar fashion, D gets affected. @ Raj...how come?? On Tue, Aug 30, 2011 at 8:11 PM, raj kumar wrote: > code becomes more efficient > > -- > You received this message because you are subscribed to the Google

Re: [algogeeks] affect of change

2011-08-30 Thread raj kumar
code becomes more efficient -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more optio

[algogeeks] affect of change

2011-08-30 Thread Anuj kumar
Which statement gets affected when i++ is changed to ++i? (A) i = 20; i++; (B) for (i = 0; i<20; i++) { } (C) a = i++; (D) while (i++ = 20) cout