Friday, May 29, 2009

c + c++ = ?

C + C++=?
Different Answers for the Question c + c++=?
Answer1:
c + c++ = 2c
c + c++ = 2c+2

Answer2:
undefined behaviour


Answer3:
how can it give undefined behavior
lets give any value to c
suppose
Int c=1
then 
c + c++ = 2
This is not an undefined behavior.


Answer4:
I think,
the ans is 2c where c =....(means any positive number)



Now Tell Me Which Answer is Correct????

3 comments: