Question: Question 1.9. Trace the following algorithm for n = 8,490,725,727, 154,368, 726, 402,945. 1. Input a positive integer n 2. d number of digits of
Question 1.9. Trace the following algorithm for n = 8,490,725,727, 154,368, 726, 402,945. 1. Input a positive integer n 2. d number of digits of n 3. While d> 1 do 3.1. n sum of digits of n 3.2 d number of digits of n 4. Output n Question 1.10. Trace the following algorithm for (a) string of integers 274390 to see if the integer 8 - 9 is contained in the string, (b) string of integers 730285 to see if the integer s = 2 is contained in the string, (c) string of integers 983650362 to see if the integer s = 5 is contained in the string, 1. Input string ..., in n and s 2. For i = 1 to n do 2.1. If x, =s then 2.1.1. Return "String contains s." 3. Return "String does not contain s
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
