259 views

1 Answer

Best answer
1 votes
1 votes
there are two tally()  lets say tally1 and tally2

firrst run tally1

               for i=1

              count value ie 0 is given to register and register value is incremented to 1

              preempt this tally1 before  storing this register value to count

run tally2

           run  for i=1 to i=4

           count will increment from 0 to 4

           preempt this tally2 before for loop runs for i=5

run tally1

this time the  register value that was 1 will get stored in count   and  count=1

preempt  this tally1

run tally2

for i=5

copy count value i.e 1 to register  and increment register    register value=2

preeempt tally2 before storing the register value to count variable

run tally1

run the remaing tally1

tally1 finish

run tally2

copy the register value to count i.e. 2
selected by

Related questions

1 votes
1 votes
2 answers
1
1 votes
1 votes
1 answer
2