Question: What is the output? Trace the algorithm (create a table) and show its steps. Step1: i=5 Step2: count=0 Step3: while (i!=1) Repeat step 3

What is the output? Trace the algorithm (create a table) and show 

What is the output? Trace the algorithm (create a table) and show its steps. Step1: i=5 Step2: count=0 Step3: while (i!=1) Repeat step 3 to 8 Step4: print count Step5: print i Step6: count++ Step7: if ((i%2)==0) i=i/2 Step8: else Step9: Stop i=3*i+1

Step by Step Solution

3.35 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To trace the algorithm and show its steps we will create a t... View full answer

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