# How to design a matrix calculator in c++

## Objective:

Design a matrix calculator in c++ . To make the solving problem about the simple matrix easy with the help of C++ program. Each step is explained below.

## Abstract:

In this project of matrix calculator we had written a program in C++ with the help of two dimensional arrays and for loop and if statement in which when user enter a matrix of order 2by2 the program give transpose, determinant, adjoints and if possible the inverse of that matrix as an output.

### Steps to code program:

This program is simple however below I have explain how it is written
• First of all we include two header files which are always ncluded in every programes means iostream.h and conio.h and after it we write void main .
• Now we start basic coding of program .Here first introduces matrix and transpose arrays and row, column, i and j for a for loop as variable datatype.
• Here we insert the determinant and adjoint variable in float and inverse variable in double data type.
• Then we ask the user to entererd the matrix elements.
• Now we declare transpose ,determinant , adjoint and inverse definition.
• Here we ask the program to display output on screen.
• Now user gets the result from the screen.

### Flow chart

#### Code of designing a matrix calculator in C++

#include<iostream.h> #include<conio.h>
Void main()
{Clrscr();
Into m,r,c,trans,t,I,j; Float adj,det; double inv[10;
Court<<”enter the rows”;
Cin>>r;
Court<<”enter column”;
Cin>>c;
Court<<”enter matrix “;
For(I=0;I<r;I++)
For(j=0;j<c;j++)
{cin>>m[I][j];}
Court<<”transpose “:
For(I=0;I<r;I++)
For(j=0;j<c;j++)
{trans[j][I]=m[I][j];}
For(I=0;I<c;I++)
For(j=0;j<r;j++)