Lab1 Orchid Array
Lab1 Orchid Array
1. Read 100 integers, find their average, and determine by how much each integer deviates
from that average.
2. Write a program using user defined functions to sum two dimensional arrays (m X n
matrix) and store the sum of the corresponding elements into third array and print all the
three arrays with its values at the corresponding places (not in a single row). Get the
transpose of the third matrix and print.
3. Write a program using an array to perform the following tasks.
Note: Use switch case for menu.
● Insert : Insert a value at the end/at any specified position.
● Delete : Delete a value from the specified position.
● Traverse : Print all the elements from 0 to n-1.
● Searching : Searching a particular value in the array.
4. Write a program to multiply two mXn matrices using dynamic memory allocation.
Hints: Two matrices are multipliable only if the columns of the first matrix are equal to
rows of second matrix. The resultant matrix will be of the size r1 X c2. Use three nested
for loops and use the following expression to calculate the element of third matrix:
c[i][j] += a[i][k] * b[k][j]
Lab Report:: Lab reports of each lab should be submitted strictly to the Department before due
date. Any type of copy and paste will be the demerit for you and no marks will be given. Each
lab report should be kept properly and should bring on final practical exam day. Lab assignment
should be of following format:
1. It should be on written format expect screenshot of your output.
2. Use A4 size paper and leave sufficient margin by drawing line on Up and Left border.
3. Title should be written on very first page before introduction
4. Cover page should include submitted to, submitted by , lab assignment no, roll no etc
5. TITLE:
6. Introduction: In this section, at first write assignment title and describe the introduction
about what you are going to do? and its background. For eg If you are going to
implement Array, you should write theoretical background of array in details in this
section
7. Flowchart:
8. Algorithm:
9. Program Code: Write your compiled program code here. Explain , where data are
stored? how program is executed ? , describe the function written etc. Note: Comments
on program are highly appreciated.
10. Output : Take program screenshot and include in this section
11. Conclusion: Finally, write conclusion and lesson learned of the whole program in this
section.
Note:
1. General Grading of your Lab assignment
● 15% Program write-up
● 75% Program Output and correctness. If your program
does not compile, you get a zero here.
● 10% Efficiency of your program. How well your program is
organized, are comments appropriate, are correct variable
declared etc