Week 7: Tuesday --------------- Q1. (30) Input a 3x3 matrix such that it is filled up with the numbers 1 to 9. Each number can be used only once. Check whether it is a magic square. A magic square is the one where the sum of each of the three rows, each of the three columns and each of the two diagonals is the same. What is this sum? Q2. (70) Write a program that prints the Pascal triangle upto height n. The Pascal triangle is an array of the binomial coefficients. However, do not calculate it directly. Instead, use the following method: The nth line has n entries. The left and right most entries are always 1. The middle entries are the sum of the entries of the previous line that are on left and right of it. The base case is the first line with a single entry 1. Here is an example of the Pascal triangle upto line 4. 1 1 1 1 2 1 1 3 3 1 Make sure that your program prints the Pascal triangle in the correct (and pretty way) as shown above. In particular, printing 4 lines in this form 1 1 1 1 2 1 1 3 3 1 will only award you partial credit. Input the positive integer n from the user. Assume that n <= 10. (You may think of using tab characters and multi-dimensional arrays. You can do it in your way as well.)