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
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
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
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
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.
>
> >
>
--~--~-~--~~
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
@ 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
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.
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.
>
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
10 matches
Mail list logo