Task#1: The function islower, shown in Figure 7.1, tests whether a character ch is lowercase or not. Write the mainfunction of a program that reads a character ch, calls the function islower, and then prints a message to indicate whether ch is a lowercase character or not.     Task#2: The recursive function fib(n) computes the nth element in the Fibonacci sequence. Implement this function in MIPS. Write a main function to call fib.   int fib(int n) { if (n < 2) return n; return (fib(n-1) + fib(n-2));       }  all using MIPS

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Task#1: The function islower, shown in Figure 7.1, tests whether a character ch is lowercase or not. Write the mainfunction of a program that reads a character ch, calls the function islower, and then prints a message to indicate whether ch is a lowercase character or not.

 

 

Task#2: The recursive function fib(n) computes the nth element in the Fibonacci sequence. Implement this function in MIPS. Write a main function to call fib.

 

int fib(int n)

{

if (n < 2)

return n;

return (fib(n-1) + fib(n-2));

      }

 all using MIPS

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning