Public feed #722609

Dark3Lite

public text v1 · immutable
Raw Edit
·published 2007-10-02 04:12 UTC
rendered paste body
In the following Algorithm segments, indicate whether or not the loop will terminate. If it will not, why not? Assume it is all integer variables.

counter <-- 0
total <-- α

DOWHILE counter >= α
       total <-- total + 2

ENDDO

b) total <-- 0
   index <-- 1
   REPEAT
       total <-- total +1
       index <-- index + 1

   UNTIL index = 10

c) counter  <--- 0
   total    <--- 0
 DOWHILE counter < = 10
total <-- total + 2
counter <-- counter + 1
ENDDO