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
Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Mathematical Statements and assignments    Within C we can directly load up the variable from within the program using the mathematical expression equates (=) e.g.   a= 'h'

Ask question #Minimum 100Problem : Compiler Design - Limit the methods Rahul is a newbie to the programming and while learning the programming language he came to know the followi



C Program for SORTING # include stdio.h> void main() {           char a;           int *p;           int i,j,temp;           clrscr();           p=&i;

Static Data Members: A data member inside the class can construct as static data member.   There are few guidelines to be followed when declaring static data member.

write a program to find the area under the curve y=f(x) between x=a & x=b

Program1: Write a program to find the factorial of a given number. The input is user given. Final output is printed out on to the screen. Program2: Write a program to gene

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec