Lecture 11:  Complex Conditions

Activity:  Documented Problem Solutions

In your group please state the values of the variables a, b, and c after executing the following code.  Also, please document how you are tracing the code and keeping track of the variables.  A possible way to keep track of this information is to use a table that lists the values of each variable for each iteration through the loop.  Remember:  getting an answer in this activity is not as important as showing your work to arrive at your solution.

#define TRUE 1
#define FALSE 0
.
.
.
/* in a function */
int a, b, c;
a = TRUE;
b = 6;
c = 8;
while ((!a) || ((b > 2) && (c <= 12))){
    if (a){
        c = b * 2;
    }
    else{
        b = c - 7;
    }
    a = (!a);
}