What is the value of each variable after the if statement? a. int n = 1; int

Question:

What is the value of each variable after the if statement?


a. int n = 1; int k = 2; int r = n;
if (k < n) { r = k; }
b. int n = 1; int k = 2; int r;
if (n < k) { r = k; }
else { r = k + n; }
c. int n = 1; int k = 2; int r = k;
if (r < k) { n = r; }
else { k = n; }
d. int n = 1; int k = 2; int r = 3;
if (r < n + k) { r = 2 * n; }
else { k = 2 * r; }

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: