Question:

What are the values of variables a, b, and c after each run of each loop.

by  |  earlier

0 LIKES UnLike

start

a = 2

b = 4

c = 10

while c > 6

perform changeBAndC()

endwhile

if a = 2 then

perform changeAAndB()

endif

if c = 10 then

perform changeAAndB()

else

perform changeBAndC()

endif

print a, b, c

stop

changeBAndC()

b = b 1

C = C - 1

return

changeAAndB()

a = a 1

b = B - 1

return

 Tags:

   Report

1 ANSWERS


  1. It looks like there are some missing operators there.  Anyway, why are you using such a primitive language?  Assuming the missing operator is a plus-sign, the results should be 3 8 5.  The main reason it's so hard is because you need a mathematical mindset to become a skilled programmer.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.