Thread: need a help here..........

  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    2

    need a help here..........

    Hello guys..i am beginner to c programming and i like to know what is happening in this code depth
    Code:
    #include<stdio.h>main(){inti=0;printf("%d %d",++i,i++);i=0;printf("\n%d",++i);i=0;printf("\n%d",i++);return0;}output is 2 0 1 0
    How this happen ...explain to me.
    Last edited by vimukthi; 05-11-2013 at 02:33 AM.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Don't start two threads on the same topic. Spammer? Likely.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,974
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed