Assignment: #CodeSnippets3 Points: 0 Due: 05/02/02018
/*
 * Execute the following code snippets by hand and record
 * what the outputs would be if executed by the computer.
 * Pretend you are a computer. Typing these code snippets
 * into a computer defeats the purpose of this assignment.
 */

/* exercise 0 */
int k = -15;
while (k) {
   cout << k << endl;
   k += 5;
}

/* exercise 1 */
bool a = true;
bool b = !a;
bool c = a || !a;

if (a && b && c)
   cout << "foo" << endl;
else if (a || b || c)
   cout << "moo" << endl;
else
   cout << "poo" << endl;

/* exercise 2 */
double n[] = { 1.618, 2.718, 3.14 };
const int X = 3;
for (int i = X - 1; i >= 0; i--)
   cout << n[i] << endl;

/* exercise 3 */
int a[4];
a[0] = a[1] = -2;
a[2] = a[3] = 5;
cout << a[0] * a[3] << endl;
cout << a[2] / a[1] << endl;