Assignment9
Warmup
Write a function that computes factorial with a for
loop. Show its operation in a simple program.
Problem 1
Write a recursive function to compute factorial. Place this function (with a different name) in the same program as before. Demonstrate that is returns the same value as your warmup function.
Problem 2
Write a recursive function to compute the Nth Fibbonacci number. This will be similar to your factorial program.
Problem 3
Returning to something like the the triangle problem from last week. Write produce a pyramid with N rows.
For example - a 6 row pyramid would look like...
*
***
*****
*******
*********
***********