rajeev kumar
Wy output of cout<<++c<
By rajeev kumar in OOP/OOD on Mar 15 2007
  • Ramchandra Desai
    Jun, 2010 15

    If you question is What will be the output then the answer is:


    This is the case of pre-increment and post-increment.
    Pre-Increment:  In this first the value of attribute is incremented by 1 and then further operation will carried out.
    Post-Increment: In this first operation is carried out and then value is incremented by 1.

    Your Example is the case of Pre-incrementation. So first the value of "c" will increment by 1 and then will perform cout operation i.e. if the value of "c" is 25 then in output we will see the value of c is 26 if you write something after second << otherwise the program will not get compiled because of the syntax problem or "; (Semicolon) " missing at the end of line. 

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS