Answer to Question #320431 in Algorithms for NTANGA

Question #320431

Rewrite the following for-loop as a pre-test while-loop. (6)



for x = 1 to 10



for y = 10 to x



if y MOD 2 = 0 then



display "*"



else



display "#"



endif



display " " ~newline




1
Expert's answer
2022-03-29T18:34:39-0400
x = 1
while x <= 10
    y = 10
    while y >= x
        if y MOD 2 = 0 then
            display "*"
        else
            display "#"
        endif
        y = y - 1
    display " " ~newline
    x = x + 1

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS