Question: What does the following algorithm do ? 1 . start 2 . store 7 in A 3 . store 0 in B 4 . add

What does the following algorithm do?
1. start
2. store 7 in A
3. store 0 in B
4. add A to B and store it in B
5. decrement (i.e subtract 1 from) the value stored in A
6. if A>0 go to step 4; otherwise, go to the next step
7. show B to the end-user
8. stop

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