lab 11.docx - Bahria University Lahore Campus Department of Computer Science Lab Journal 11(Spring 2020 Course Course Code Faculty\u2019s Name Computer

lab 11.docx - Bahria University Lahore Campus Department of...

This preview shows page 1 - 3 out of 4 pages.

Bahria University, Lahore Campus Department of Computer Science Lab Journal 11 (Spring 2020) Course: Computer Programming Lab Date: _______________ Course Code: CSL-113 Max Marks: 20 Faculty’s Name: Lab Engineer: Tayyab Mir Name: _____________________ Enroll No: ___________________ Class: ______________ Objective(s): To Understand about: 1. Apply Arrays in C++ 2. Use of Two and Three Dimensional Array Lab Tasks: **Provide solution of each task and screenshot of output at the end of that task** Task 1 Write a program to perform matrix multiplication of m x n matrix.
Image of page 1
Enrollment Number: ____________________________ Given the condition if number of rows of first matrix equal to the number of rows of the second matrix. < Solution and output of Task 1 > CODE: #include <iostream> using namespace std ; //03-134192-065 int main () { int a [ 20 ][ 20 ], b [ 20 ][ 20 ], c [ 20 ][ 20 ], row1 = 0 , col1 = 0 , row2 = 0 , col2 = 0 ; cout << "Enter number of rows and columns of matrix A : " << endl ; cin >> row1 >> col1 ; cout << "Enter number of rows and columns of matrix B : " << endl ; cin >> row2 >> col2 ; while ( row1 != row2 ) { cout << "NO of row of 1st matrix not equal to row of 2nd matrix " << endl ; cout << "Enter number of rows and columns of matrix A : " << endl ; cin >> row1 >>
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 4 pages?

  • Spring '19
  • ASIM ALI
  • Multiplication, Carriage return, The Matrix Reloaded, Row

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture