Professional Documents
Culture Documents
Task 1
Write a program that reads two arrays from the user of the same size:
Lab_Marks: contains double numbers representing the students’ lab marks
Absences: contains integer numbers representing the total absences for each student.
The program then calls a function called (CalcTotal) that will take Lab_Marks
and Absences as an input and returns an array Result of type double that contains the result of
subtracting each element in Absences from the corresponding element in Lab_Marks
Absences 5 3 2 0 3
Task 2:
Write a C++ function which computes sum of two square matrices using two-dimensional array
in C++.
SAMPLE OUTPUT:
Enter matrix 1
1 2 3
4 5 6
1 2 3
Enter matrix 2
3 4 5
8 7 6
9 1 11
0
Sum of matrices is
4 6 8
12 11 12
10 12 14
Bonus Task:
Create an array of user defined size. Fill this array with random numbers (Auto Generated). Create a
menu from 1 to 6 to perform operation on array. As the option is selected.
1. Update array (Single indexed value)
2. Print the array
3. Find minimum
4. Find maximum
5. Search a number
6. Sort the array
7. Print the array in reverse order
Bonus Task:
Write a C++ program which computes product of two square matrices using two-dimensional
array in C++.
SAMPLE OUTPUT:
Enter matrix 1
1 2 3
4 5 6
7 8 9
Enter matrix 2
9 8 7
6 5 4
3 2 1