Question: What is the value of r after this code segment? int n = 1; int k = 2; int r = 5; if (nk).
What is the value of r after this code segment? int n = 1; int k = 2; int r = 5; if (nk). { K++; } r -=k; else { } *= 2; r = k + n;
Step by Step Solution
There are 3 Steps involved in it
Lets analyze the code segment step by step Initialize variables n 1 k 2 r 5 Evaluate the condition o... View full answer
Get step-by-step solutions from verified subject matter experts
