a. Define the term recursion. (2 Marks) b. In order to solve a problem recursively, two conditions must be satisfied. (2 Marks) c. The Fibonacci series has the following form: 0, 1,1,2,3,5,8…. It can be solved recursively fib(n)=fib(n-1) + fib(n-2) i.e the nth fibonacci number is defined as shown b the above expression. Write a function using recursion that calculates the nth recursive number. For instance fib(3) = 1 i.e 1 + 0 and fib(4) = 2 i.e 1 + 1. Tip; The base case: fib(0)=0 and fib(1)=1. Use your function in a main program where you ask the user to a number n and then you output the nth Fibonacci number. (8 Marks)
d. Write a function that converts an input string to uppercase. The argument to the function is a string. The function then returns the string in uppercase. Use your function in a main program where you ask the user to enter a string and then you output the string in uppercase. Do not use the strupr or toupper functions. You have to use a loop. Hint: Characters in C are stored as integers using the American Standard Code for information interchange ( ASCII). The lower case characters are given the integers 97 to 122 where ‘a’=97, ‘b’=98,… The uppercase characters are represented by the integers 65 to 95 where ‘A’=65, ‘B’=66…If you have the statement putchar (97) in your program, then the character ‘a’ is output on the screen. Since characters are integers, then it is possible to do some basic mathematics with them e.g’a’+ 2=99 which is equal to c. (8 Marks

 

 

 

 

 

 

For a custom-written paper on the above topic, place your order now!

What We Offer
• On-time delivery guarantee
• PhD-level professionals
• Automatic plagiarism check
• 100% money-back guarantee
• 100% Privacy and Confidentiality
• High Quality custom-written papers

Found something interesting ?

• On-time delivery guarantee
• PhD-level professional writers
• Free Plagiarism Report

• 100% money-back guarantee
• Absolute Privacy & Confidentiality
• High Quality custom-written papers

Related Model Questions

Feel free to peruse our college and university model questions. If any our our assignment tasks interests you, click to place your order. Every paper is written by our professional essay writers from scratch to avoid plagiarism. We guarantee highest quality of work besides delivering your paper on time.

Grab your Discount!

25% Coupon Code: SAVE25
get 25% !!