## Count all the columns in a matrix which are sorted in descending

Given a matrix mat[][], the task is to count the number of columns that are sorted in descending. Examples: Input: mat[][] = {{1, 3}, {0,… Read More »

## Interchange elements of first and last columns in matrix

Given a 4 x 4 matrix, the task is to interchange the elements of first and last columns and show the resulting matrix. Examples: Input:… Read More »

## Find alphabet in a Matrix which has maximum number of stars around it

Given a matrix mat consisting of * and lowercase English alphabets, the task is to find the character which has the maximum number of *… Read More »

## Replace the middle element of matrix with sum of surrounding elements

Given a square matrix mat[][] of odd dimensions, the task is to change the value of the middle most element of the matrix to the… Read More »

## Find smallest and largest element from square matrix diagonals

Given a square matrix of order n*n, find the smallest and largest elements from both diagonals of the given matrix. Examples: Input : matrix =… Read More »

## Fill missing entries of a magic square

Given a 3X3 matrix mat with it’s left diagonal elements missing (set to 0), considering the sum of every row, column and diagonal of the… Read More »

## Find the intersection of two Matrices

Given two matrix A[][] and B[][] of same order m*n. The task is to find the intersection of both matrix as C, where: Cij =… Read More »

## Problem of 8 Neighbours of an element in a 2-D Matrix

Given a 2-D Matrix and an integer ‘K’, the task is to predict the matrix after ‘K’ iterations given as follows: An element 1 in… Read More »

## Sorting rows of matrix in descending order followed by columns in ascending order

Given a matrix of distinct elements. The task is to sort the rows of matrix in descending order followed by sorting the columns in ascending… Read More »

## Find determinant of matrix generated by array rotation

Given an array of three element. The task is to construct a matrix of order 3*3 by using all three rotation of array as row… Read More »

## Program to convert the diagonal elements of the matrix to 0

Given an N*N matrix. The task is to convert the elements of diagonal of a matrix to 0. Examples: Input: mat[][] = {{ 2, 1,… Read More »

## Find maximum element of each column in a matrix

Given a matrix, the task is to find the maximum element of each column. Examples: Input: [1, 2, 3] [1, 4, 9] [76, 34, 21]… Read More »

## Print sum of matrix and its mirror image

You are given a matrix of order N*N. The task is to find the resultant matrix by adding the mirror image of given matrix with… Read More »

## Minimum element of each row and each column in a matrix

Given a matrix, the task is to find the minimum element of each row and each column. Examples: Input: [1, 2, 3] [1, 4, 9]… Read More »

## Product of middle row and column in an odd square matrix

Given an integer square matrix of odd dimensions (3 * 3, 5 * 5). The task is to find the product of the middle row… Read More »