Skip to content
Programming101
Programming101

Learn everything about programming

  • Home
  • CS Subjects
    • IoT – Internet of Things
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programming101
Programming101

Learn everything about programming

C++ program for Matrix Multiplication

YASH PAL, 31 July 202422 August 2024

In this post, we will write a C++ program for Matrix Multiplication.

C++ program for Matrix Multiplication

C++ program for Matrix Multiplication.

#include<iostream>
#include<conio.h>
#include<stdio.h>

int main()
{
    system("cls");

    int a[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
    int b[3][3];
    int i,j,k;

    for(i=0;i<3;i++)
    {
        for(j=0;j<3;j++)
        {
            b[i][j] = 0;
            for(k=0;k<3;k++)
            {
                b[i][j] += a[i][k]*a[k][j];
            }
        }
    }
    for(i=0;i<3;i++)
    {
        for(j=0;j<3;j++)
        {
            std::cout<<"t"<<b[j][i];
        }
        std::cout<<"n";
    }

    getch();
    return 0;
}

Output

30 66 102
36 81 126
42 96 150
coding problems cpp

Post navigation

Previous post
Next post
  • HackerRank Separate the Numbers solution
  • How AI Is Revolutionizing Personalized Learning in Schools
  • GTA 5 is the Game of the Year for 2024 and 2025
  • Hackerrank Day 5 loops 30 days of code solution
  • Hackerrank Day 6 Lets Review 30 days of code solution
©2025 Programming101 | WordPress Theme by SuperbThemes