# Program to find Transpose of Matrix in C++

Here is the Program to find Transpose of Matrix in C++ PROGRAM: #include<iostream> using namespace std; int main() { int a[10][10],m,n,i,j; cout<<“Enter number of rows: “; cin>>m; cout<<“Enter number of coloumns: “; cin>>n; if(m!=n) { cout<<“Matrix not square so Transpose not possible :(“; } else { cout<<endl<<“Enter elements of matrix: “<<endl; for(i=0;i<m;i++) { for(j=0;j<n;j++) { cout<<“Enter element a”<<i+1<<j+1<<“: “; cin>>a[i][j];…

# Matrix multiplication in C++

How matrix multiplication in C++ Works:   Input two matrices. Run 3 for loops (i,j,k). Multiplication will be addition of First_Matrix[i][k]*Second_Matrix[k][j] for each element. Resultant matrix is stored in third Matrix.   CODE: #include<iostream> using namespace std; int main(){ //Using const int for array size const int row=2,col=2; // if not use const error found cout<<“Size of Matrices : “<<row<<“…

# Addition of two matrix in C++

How It Works: For 2D array size there must be constant value in square brackets like  array[constant value][constant value].   Two const variables row and col are used to define size. if we do not make both const then error found because without const reserve word they are behaving as variable. Before placing both variable in square brackets they must…

# Program to find Maximum and Minimum element in Array C++

How it Works: Declare array of size 10 Using for loop assign array indexes with random values between 1 and 1000. Call the function and pass array and its size as argument. Function declares two integers max and min and assign both integers with arrays first index value. Then with in for loop there are two if condition first check…

# Program to Insert Update and Delete elements in Array in C++

How it Works: This code is managing a small database in array like insert, update and delete integer values in array. Program has global array declaration of size 10. Global declaration allows it accessible inside any function. A function name “Default values” is initializing all array indexes by default value of -1. A function name “Display Array” displays the array…

# Program to Reverse an Array in C++

Program explanation: Program declare an integer array of size five, initialize it using for loop.  Pass size and array name to function. Function uses for loop and swap array elements with in it.  A for loop is used to display the final result. Following is the program to reverse an array. #include <iostream> using namespace std; void Reverse_Array(int array[],int size)…