🧠 2D Array Practice Problems

🧠 2D Array Practice Problems in C

✅ Problem 1: Input and Print a 2x2 Matrix

Write a program to take input for a 2x2 matrix and display the matrix.

Example:

Input: 1 2
       3 4
Output: 
1 2
3 4

✅ Problem 2: Sum of All Elements in a Matrix

Write a program to calculate the sum of all elements in a 3x3 matrix.

✅ Problem 3: Find Maximum Element in a 2D Array

Take a 3x3 matrix input from the user and display the maximum number.

✅ Problem 4: Row-wise Sum of a 2D Array

Write a program to compute and display the sum of each row in a 4x2 matrix.

✅ Problem 5: Transpose of a Matrix

Write a C program to find the transpose of a 3x3 matrix.

Hint: Transpose: B[i][j] = A[j][i]

✅ Problem 6: Multiply Two Matrices

Write a program to multiply two 2x2 matrices.

✅ Problem 7: Identity Matrix Check

Check if a 3x3 matrix is an identity matrix (1 on the diagonal, 0 elsewhere).

✅ Problem 8: Diagonal Sum of Square Matrix

Calculate the sum of the main diagonal of a 4x4 matrix.

✅ Problem 9: Count Zeros in a Matrix

Count how many zeros are in a given 5x5 matrix.

✅ Problem 10: Replace Negative Elements with Zero

Write a program that replaces all negative numbers in a 2D matrix with zero.

C array practice problems, 2D array challenges in C, matrix programming in C, C programming problem set, C matrix example exercises
2D Array Practice Problems in C
C array practice problems, array exercises in C, 1D array C programming, 2D array matrix problems C, C programming array examples, C language array questions, C programming with solutions, C practice for beginners, C matrix problems, C programming practice set, #CProgramming #ArrayPractice #CArrayProblems #2DArray #LearnC #CodingInC #CProgrammingTutorial #PracticeC #MatrixInC #ProgrammingExercises
⬅️ Previous

একটি মন্তব্য পোস্ট করুন