Set A . Write C programs for the following problems.
1. Write a program to accept a matrix A of size mXn and store its transpose in matrix B. Display matrix B. Write separate functions.
2. Write a program to add and multiply two matrices. Write separate functions to accept,display, add and multiply the matrices. Perform necessary checks before adding and multiplying the matrices.
Set B . Write C programs for the following problems.
1. Write a menu driven program to perform the following operations on a square matrix. Write separate functions for each option.
i) Check if the matrix is symmetric.
ii) Display the trace of the matrix (sum of diagonal elements).
iii) Check if the matrix is an upper triangular matrix.
iv) Check if the matrix is a lower triangular matrix.
v) Check if it is an identity matrix.
2. Write a program to accept an mXn matrix and display an m+1 X n+1 matrix such that the m+1th row contains the sum of all elements of corresponding row and the n+1th column contains the sum of elements of the corresponding column.
A B
1 2 3 1 2 3 6
4 5 6 4 5 6 15
7 8 9 7 8 9 24
12 15 18 45
Set C. Write programs to solve the following problems
1. Pascal's triangle is a geometric arrangement of the binomial coefficients in a triangle. It is named after Blaise Pascal. Write a program to display n lines of the triangle.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1. Write a program to accept a matrix A of size mXn and store its transpose in matrix B. Display matrix B. Write separate functions.
2. Write a program to add and multiply two matrices. Write separate functions to accept,display, add and multiply the matrices. Perform necessary checks before adding and multiplying the matrices.
Set B . Write C programs for the following problems.
1. Write a menu driven program to perform the following operations on a square matrix. Write separate functions for each option.
i) Check if the matrix is symmetric.
ii) Display the trace of the matrix (sum of diagonal elements).
iii) Check if the matrix is an upper triangular matrix.
iv) Check if the matrix is a lower triangular matrix.
v) Check if it is an identity matrix.
2. Write a program to accept an mXn matrix and display an m+1 X n+1 matrix such that the m+1th row contains the sum of all elements of corresponding row and the n+1th column contains the sum of elements of the corresponding column.
A B
1 2 3 1 2 3 6
4 5 6 4 5 6 15
7 8 9 7 8 9 24
12 15 18 45
Set C. Write programs to solve the following problems
1. Pascal's triangle is a geometric arrangement of the binomial coefficients in a triangle. It is named after Blaise Pascal. Write a program to display n lines of the triangle.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 Comments
sefg
ReplyDelete