Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Matrix Operations in C

About

This is a simple C program that performs basic matrix operations:

  • Addition
  • Multiplication
  • Transpose

It uses functions and 2D arrays for better understanding.


How to Run

  1. Compile the program:
gcc matrix.c -o matrix
  1. Run the program:
.\matrix

File Structure

Matrix/
|-matrix.c
|-matrix.png
|-README.md

Example Input

Enter rows and columns of Matrix A:2 2
Enter rows and columns of Matrix B:2 2

Enter elements of Matrix A:
Enter element [0][0]: 1
Enter element [0][1]: 2
Enter element [1][0]: 3
Enter element [1][1]: 4

Enter elements of Matrix B:
Enter element [0][0]: 5
Enter element [0][1]: 6
Enter element [1][0]: 7
Enter element [1][1]: 8


Example Output

Matrix Addition Result:
6 8
10 12

Matrix Multiplication Result:
19 22
43 50

Transpose of Matrix A:
1 3
2 4

Output Screenshot

Output



Concepts Used

  • 2D Arrays
  • Functions
  • Loops

Author

M.Bharadwaj

About

A simple C program that performs matrix addition, subtraction, multiplication, and transpose using a menu-driven interface.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages