Question: Consider the Java statements if (n >= 2) n = n * 3; if (n >= 6) n++; Which one of the following has the
Consider the Java statements
if (n >= 2) n = n * 3;
if (n >= 6) n++;
Which one of the following has the same final effect as the above sequence?
A. n=3*n+1;
B. if(n>=2)n=3*n+1;
C. if (n >= 6) n = 3 * n + 1; D. if((n>=2)&&(n<=6))n=3*n+1;
E.
if (n >=2) n = 3 * n;? else if (n >= 6) n = n + 1;?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
