Complete the function fibonacci to return an array containing the first N Fibonacci numbers. fib(n) = n , n <= 1 fib(n) = fib(n-2) + fib(n-1), otherwise Constraints: 1 ≤ N ≤ 10 Sample Input 4 Sample Output 0 […]
Calculate Factorial
Write a program that will read an integer N from STDIN and compute the factorial of N. The input to your program will contain many lines. On each line there will be exactly one integer. Your program should print the factorial of each integer in a separate line. Your program should terminate when it reads a number […]