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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!