Assignment: #CodeSnippets1 Points: 0 Due: 04/30/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 n = 32;
int log2 = 0;
int i = 1;
for (; i < n; i *= 2)
   log2++;
cout << "2^" << log2 << " = " << n << endl;

/* exercise 1 */
int k = 1000;
int j = k;
int count = 0;
while (k / 10) {
   count++;
   k /= 10;  /* k = k / 10 */
}
cout << 10 << "^" << count << " = " << j << endl;

/* exercise 2 */
cout << 13 / 5.0 << endl;

/* exercise 3 */
if (42 || !37 && !0 || 1)
   cout << true << endl;
else
   cout << false << endl;

/* exercise 4 */
if (!(true && !false) || (true && !true))
   cout << true << endl;
else
   cout << false << endl;