Results 1 to 2 of 2

Thread: c program concept..

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Answers
    18

    Smile c program concept..

    hi frnds..

    looking a very simple program...when you analyse out put must be
    45545....

    but the same program you run on the PC(microsoft visula c++ tool) it will show out put
    55545..

    why ?
    can any body help me on this occasion ?

    void main()
    {
    int i;
    printf("%d%d%d%d%d",i++,i--,++i,--i,i);
    getch();
    }


  2. #2
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    Re: c program concept..

    I can only assume that there is an order of precedence here. I'm just not sure if its adding everything first and then incremeting it or v.s.

    I have attached two url's that go on about this in a little more detail.

    http://www.embedded.com/shared/prin...ticleID=9900607

    http://www.adp-gmbh.ch/blog/2005/march/17.html

    ---------------------------
    suresh


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact