a write a recursive procedure digits n that


(a) Write a recursive procedure (digits n) that computes the number of digits in the integer n using a linear recursive process. For example, (digits 42) should return 2 and (digits 13579) should return 5.

(b) Rewrite (a) such that a linear iterative process is produced. Call the procedure digits-it.

(c) Using the substitution model, show that your procedure in (b) generates a linear iterative process.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: a write a recursive procedure digits n that
Reference No:- TGS0219169

Expected delivery within 24 Hours