Question: You probably know how to check whether a decimal number n is divisible by 3 . Add the sum of the digits and check whether

 You probably know how to check whether a decimal number n

You probably know how to check whether a decimal number n is divisible by 3 . Add the sum of the digits and check whether that is divisible by three. But that's not quite good enough for an algorithm. How do we know whether the sum of the digits is divisible by three? You can do it again. For example, consider 8792 . The sum of the digits is 8+7+9+2=26. And the sum of those digits is 2+6=8. That's not divisible by 3 . What if the number is so large that the sum of the digits has three digits, like 789999999999999999 , whose digit sum is 157 ? That's still ok. Just keep doing it until only one digit is left. The first two steps of this algorithm are given. Rearrange the following lines of code to produce pseudocode for the rest of the algorithm. Pay attention to the indentation. Pseudocode inside the while loop or For loop will be indented by one tab, and pseudocode inside an If statement or an Else statement will also be indented by one tab. number = n // Step 1 While number >9// Step 2 If unable to drag and drop, refresh the page

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!