CS13002 Programming and Data Structures

(Autumn semester)    Section A

Assignment Set - 8

Please write your Roll Number, Name and Assignment Number at the header of each program.


Assignment 8.a:        Filename: a8a.c

You have to write a program that performs the following tasks:

  1. It reads the value of integer N, and then reads in a two matrices of floats, namely A[N][N] and X[N].

  2. It prints a saddle point of the matrix (if it exists). It must print both the value and the position of the saddle point.

  3. Write a function to compute the product of matrices and use it to compute the product of the matrices A and X

  4. It uses the upper triangulation approach to solve the set of linear equations specified by A and X. It must print the upper triangular matrix derived from A

Information:

      2x + y - z   = 8
   
-3x - y + 2z = -11
   
-2x + y + 2z = -3

The augmented matrix is:

2 1 -1 8
-3 -1 2 -11
-2 1 2 -3

The upper triangular form is:

2 1 -1 8
0 1/2 1/2 1
0 0 -1 1

The values of x, y and z can now be computed by back substitution. The third row yields the value of z as -1. We can substitute this value and compute the value of y from the second row, and so on. In this example the values are: x=2, y=3, z= -1


Course home