Solution for Exercise 11-5

ex1105

#include <stdio.h>

int main()
{
    int a,b;

    b=16;
    printf("Before, a is unassigned and b=%d\n",b);
    a=b++;
    printf("After, a=%d and b=%d\n",a,b);
    return(0);
}

Notes

* Here is the output I see:

* The value of b is assigned to a first, then the value of b is incremented.

* I find myself writing code like this all the time, because it's easy to forget how things work in C. Especially when you get into pointers, you may find yourself writing tiny reminder programs as to how things work.