Monday, February 06, 2006

[homage] Programming Exercises

While spending half day waiting at the Bangkok hospital, I manage to inflict my sister with an introduction to recursive functions. What's really cool, is that she totally got it and loved it. Here are the exercises we did:

1) Write the logic to calculate the Factorial of N.

2) Write the logic to calculate the Factorial of N, without using a loop.

3) Write the logic to calculate the Nth number in the Fibonacci Sequence.

(Next family vacation: data structures)