[algogeeks] Re: Citrix interview question

2009-09-16 Thread rajni
ya!! i thnk its compiler dependent cz when i tried this in devc++ compiler nd its o/p is 49 not 56...nd i didnt find any explanation to this... On Sep 15, 6:40 pm, ankur aggarwal wrote: > compiler dependent as simple as that.. --~--~-~--~~~---~--~~ You received t

[algogeeks] Re: Citrix interview question

2009-09-15 Thread Geoffrey Summerhayes
On Sep 15, 11:10 am, CM Saikanth Varma wrote: > The answer is indeed 56. > Explanation: Increment operator has highest priority > so (i++)*(i++) will be evaluated as > (7)*(8)=56 > This is valid only in C > I don't have the final c99 standard available, this is from the draft: 5.1.2.3 Program

[algogeeks] Re: Citrix interview question

2009-09-15 Thread CM Saikanth Varma
The answer is indeed 56. Explanation: Increment operator has highest priority so (i++)*(i++) will be evaluated as (7)*(8)=56 This is valid only in C On Tue, Sep 15, 2009 at 6:45 PM, nitin mathur wrote: > @ Tanmoy > Same logic I explained..interviewer didn't give me any clue whether > the explaina

[algogeeks] Re: Citrix interview question

2009-09-15 Thread ankur aggarwal
compiler dependent as simple as that.. --~--~-~--~~~---~--~~ 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 emai

[algogeeks] Re: Citrix interview question

2009-09-15 Thread Paritosh Aggarwal
you can just try running it.. On Tue, Sep 15, 2009 at 6:45 PM, nitin mathur wrote: > @ Tanmoy > Same logic I explained..interviewer didn't give me any clue whether > the explaination is correct or not.. > > but when I googled it now I found the answer 56. > > > > --~--~-~--~~

[algogeeks] Re: Citrix interview question

2009-09-15 Thread Geoffrey Summerhayes
On Sep 15, 9:15 am, nitin mathur wrote: > @ Tanmoy > Same logic I explained..interviewer didn't give me any clue whether > the explaination is correct or not.. > > but when I googled it now I found the answer 56. Still not correct. The standard was specific (I assume the latest version hasn't

[algogeeks] Re: Citrix interview question

2009-09-15 Thread nitin mathur
@ Tanmoy Same logic I explained..interviewer didn't give me any clue whether the explaination is correct or not.. but when I googled it now I found the answer 56. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algo

[algogeeks] Re: Citrix interview question

2009-09-15 Thread nitin mathur
ya thats correct these are "side effect operations". But in C still its valid.. --~--~-~--~~~---~--~~ 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.

[algogeeks] Re: Citrix interview question

2009-09-15 Thread Tanmoy Sarkar
It will print 49 and the value of i after execution of printf statement becomes 9 so since its a postfix increment first i*i is done and then i will be incremented twice On Tue, Sep 15, 2009 at 6:27 PM, ntini wrote: > > Hi Friends, > > Today I had interview @ Citrix. I was asked a question. >

[algogeeks] Re: Citrix interview question

2009-09-15 Thread Chunyuan Ge
hi: for these kinda questions, the behavior is not defined. as in C++ standard, it's not suggested to have two ++ in one expression. So the result may depends on compiler. Regards, Chunyuan On Tue, Sep 15, 2009 at 8:57 PM, ntini wrote: > > Hi Friends, > > Today I had interview @ Citrix. I was