Question: The following program segment should print 0 2 4 6 on separate lines by using a while loop. Arrange the code so that accum prints

The following program segment should print 0246 on separate lines by using a while loop. Arrange the code so that accum prints before increasing its value. The lines have been mixed up and include extra code that isnt needed in the solution. Put the code in the correct order.
accum = accum +1;
end
disp(accum)
accum =0;
while accum <7
accum =2;
while accum <6
accum = accum +2;
accum +2;

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 Programming Questions!