Question: 3. A decimal integer number N can be converted into Binary form, using the following recursive algorithm: Decimal To Binary (N) If N=0 or N=1

3. A decimal integer number N can be converted into Binary form, using the following recursive algorithm: Decimal To Binary (N) If N=0 or N=1 Print N Else Decimal_To_Binary(N/2) Print Nmod2 Write the complete C+ program using the above pseudocode for the function Decimal_To_Binary and main function. Main should call this program be suitably sending user inputs for N and make sure to run the program with a value of N in the range (i) between 1 and 15 (ii) in the range from 24 to 29 and (iii) in the range from 51 to 4. The Ackermann function is a fast growing function that takes two nonnegative integers: m and n, and the algorithm is defined as below: A(m,n)=n+1ifm=0 =A(m1,1)ifn=0 =A(m1,A(m,n1)), otherwise Write this function in C++ and test the function by calling it from main by using a nested loop, by varying m=0 to 3 and inside the m loop, use another loop to vary n from 0 to 10 The program should display a table for all Ackermann number generated as below: The inside the table the computed A values must be displayed. 1. a) Given a recursive algorithm as below: int F( int n) if (n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
