• TCS: Post the output of following statement :- a+++++b

    What should be the output of the following code if we print,  like

    void main() 
    {

    int a=4,b=3,x;
    x=a+++++b;
    printf("Value of x is :%d", x);

    }

    ----------------------------------

    Being honest, If you dont know the answer join our site for all latest questions like this.

    Have fun!!

4 comments:

  1. Anonymous said...

    bt y it iz showing l value error........it shud print 8....dat is wat i suppose

  2. Unknown said...

    buddy it will always show an error. Because any compiler counts the maximum characters in a token.(if it encounters 2 plus without a space like ++.it will count it as 1 not 2)

    in +++++ all +' will get seperated in this format ++ ++ +
    which is an error.
    and you were predicting it to speerate in following fashion
    ++ + ++(which is an error)

  3. 9

  4. Unknown said...

    Buddy it is an error..
    For explanation see the the comments above

Post a Comment