C Program to Check if Two Matrices Are Equal

Two matrices are equal if and only if they have the same dimensions (same number of rows and same number of columns) and every corresponding pair of elements is equal: A[i][j] == B[i][j] for all i, j. If the dimensions differ, equality is impossible. This program checks both conditions. The original had void main(), exit(1) …

C Program to find the Multiplication of two matrices

C Program to find the Multiplication of two matrices. C Program Develop functions a) To read a given matrix b) To output a matrix c) To compute the product of two matrices Use the above functions to read in two matrices A (MxN) B (NxM), to compute the product of the two matrices, to output …

C Program to Sort N Elements Using Selection Sort — With Step-by-Step Example

Selection Sort works by repeatedly finding the minimum element from the unsorted portion of the array and placing it at the beginning. After each pass, the sorted portion grows by one element from the left. It always performs exactly O(n²) comparisons regardless of input order — unlike Bubble or Insertion Sort, there is no early …

C Program to read an English sentence and replace lowercase characters by uppercase and vice-versa.

This program reads a sentence and swaps the case of every letter — uppercase becomes lowercase, lowercase becomes uppercase. Digits, spaces, and punctuation are left unchanged. The <ctype.h> functions isupper(), islower(), toupper(), and tolower() make this clean and portable across all ASCII and extended character sets. The original post used conio.h, void main(), a broken …

C program to check whether a given string is palindrome or not

A palindrome is a word, sentence, or sequence that reads the same forward and backward — ignoring differences in capitalization for word-level palindromes. Examples: “racecar”, “GADAG”, “level”, “9009”. The most efficient check uses a two-pointer approach: one pointer starts at the left end, one at the right, and they advance toward each other until they …

C Program to Find the Transpose of a Matrix — Rectangular and In-Place Square

The transpose of a matrix is formed by flipping it over its main diagonal — rows become columns and columns become rows. If the original matrix is of order M×N, its transpose is of order N×M, where element A[i][j] becomes B[j][i]. Matrix A (3×2): Transpose B (2×3): 1 2 1 3 5 3 4 → …