Task 1
Task 1
2. Write a C++ program to multiply two matrices and print the product.
If the entered matrices are not compatible then print a message
saying so.
3. In a given matrix for all zero elements the corresponding row and
column must be replaced with zeroes. Write a C++ program to do
that.
Eg: Input: [ 1 2 0 Output: [ 0 0 0
234 230
333] 330]
6. Write a function for Bubble and Selection Sort. Ask the user for
which method to use: ‘s’ for Selection Sort and ‘b’ for Bubble Sort.
Call the correct function based on the user’s choice. After sorting
the array, call another function that implements Binary Search to
find the position of the number taken as input from the user. [Take
the array as input from the user].
7. Write a function to copy a string into another string using pointers.
Output: cat
word
number
10. Display the first 40 terms of the Fibonacci sequence using recursion.
It should not take more than 1 second to execute the program.
16. Input any graph, create its adjacency matrix and perform Dijkstra's,
Kruskal's, and Prim's Algorithm.