0% found this document useful (0 votes)
8 views

PFLAB10

The document provides instructions for 8 programming tasks. Task 1 involves operations on a 2D array such as displaying, finding min/max, sums, and transpose. Task 2 involves adding and multiplying 2D arrays. Task 3 checks if a 2D array is symmetric. Task 4 checks if a 2D array is an identity matrix. Tasks 5-7 involve determinants, sums of triangular matrices, and displaying a pattern. Task 8 takes input on students and outputs the data.

Uploaded by

Shumyze Najam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

PFLAB10

The document provides instructions for 8 programming tasks. Task 1 involves operations on a 2D array such as displaying, finding min/max, sums, and transpose. Task 2 involves adding and multiplying 2D arrays. Task 3 checks if a 2D array is symmetric. Task 4 checks if a 2D array is an identity matrix. Tasks 5-7 involve determinants, sums of triangular matrices, and displaying a pattern. Task 8 takes input on students and outputs the data.

Uploaded by

Shumyze Najam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Programming Fundamental LAB – Fall 2019

(MSc-CS-F19 Morning)
Lab # 10

Instructions:

 Indent your code properly. 

 Use meaningful variable names. Use camelCase notation.

 Use meaningful prompt lines/labels for all input/output.

Task 1: Write a program that take input in 2D array of and perform the following operations on 2D
array:

i) Display it as a matrix.

ii) Find Smallest and Largest Element.

iii) Find the Largest and Smallest Element of each row.

iv) Find the Largest and Smallest Element of each column.

v) Find the sum of 2D array.

vi) Find the sum of each row.

vii) Find the sum of each column.

viii) Display the transpose of 2D array.

Note: Display proper headings before each operation.

Task 2: Write a program that take input in two 2D arrays of integer of size 4x4 and find the addition and
multiplication these arrays.

Task 3: Write a program that take input in 2D array and check whether the matrix is Symmetric or not.

Hint: A matrix is Symmetric if it is equal to its transpose. ( A = At )

Task 4: Write a program that take input in 2D array and check whether the matrix is Identity matrix or
not.
Hint: A matrix is Identity matrix if its all diagonal values are 1 and non-diagonal values are 0.

Task 5: Write a program to find the determinent of 3x3 matrix.

Task 6: Write a program to find the sum of upper and lower triangular matrix.

For Example if a matrix is 1 2 3

4 5 6

7 8 9

Sum of Upper Triangular matrix is: 11

Sum of Lower Triangular matrix is: 19

Task 7: Write program that display the following patteren:

1 2 3 4 5

16 17 18 19 6

15 24 25 20 7

14 23 22 21 8

13 12 11 10 9

Task 8: Write a program that take input of 5 students, Input contain rollNo , studentName, fatherName,
city, degree and CGPA.

For Example:

Input:

Enter Data for 1 Student.

Enter Roll no: MCSF19M123

Enter Name: ABC

Enter Father Name: XYZ

Enter City Name: Lahore

Enter Degree Name: MSc Computer Science.


Enter the CGPA:3.8

Output:

Roll no of 1 Student is MCSF19M123

Name of 1 Student is ABC.

Father Name of 1 Student is XYZ.

City of 1 student is Lahore.

Degree of 1 Student is Msc Computer Science.

CGPA of 1 Student is 3.80

Note: Strictly Follow the input and output as mention in above Example.

VERY IMPORTANT

In the next Lab, you will need some or all of the programmes from Today’s Lab. So, make sure that you
have the working implementation of ALL the programmes of Today’s Lab, when you come to the next
Lab.

You might also like