Recursive procedure to computes the number of digits, C/C++ Programming

(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.

 

Posted Date: 3/28/2013 3:27:12 AM | Location : United States







Related Discussions:- Recursive procedure to computes the number of digits, Assignment Help, Ask Question on Recursive procedure to computes the number of digits, Get Answer, Expert's Help, Recursive procedure to computes the number of digits Discussions

Write discussion on Recursive procedure to computes the number of digits
Your posts are moderated
Related Questions

algorithm to find out all the factors of given positive integers

railway reservation programming


Write a program that predicts users age: Write a program that predicts users' age (0-128 years old) with at most 7 questions. The game starts with asking the user whether he/s


C++ Programming Assignment ATM Machine Phase 1 In this assignment you will create a program that allows a user to do the following: 1) Create a bank account by supplying a use

#include using namespace std; void print(int marks_arr[],int cnt) { int ind[cnt]; int i=0; int j=0; int k=0; int s=0; for(k=0;k { ind[k]=0; } int cnt1=0; for(i=0;i

Your task in this project is to write a C program named layout.c which does text layout. This is a staged project, complete the stages in order. The maximum mark if you nish each

Write a C++ program that reads from keyboard 3 integers, with proper input prompt, and then displays the maximum sum of any pair of numbers from these three. If the 3 numbers are 5