Texinterest
Sign in
x
Texinterest
Empower your learning
About Us
Privacy Policy
Forum Discussions
C Programming
Subjects
Science
Computer
Programming
English
General Knowledge
Rennaissance
Courses
Exams
Interviews
Add Notes
Contact us
Menu
Science
Computer
Programming
English
General Knowledge
Rennaissance
Two Dimensional Arrays in C Programming
A Two-dimensional array is in the form of matrics, which contains rows and columns.
A Two-dimensional array is in the form of matrics, which contains rows and columns.
A 2D array a[m][n] is a table with m rows and n columns.
It contains m x n elements.
Row index starts from 0 to m-1 and column size starts from 0 to n-1.
Each element has to subscripts. ie a[0][0], a[0][1],……
Syntax
DATATYPE ARRAYNAME[ROWSIZE][COLUMN SIZE];
Example
int m[10][10];
Here m is an integer array that can store 10 rows and columns.
It contains 100 elements.
location starts from m[0][0],m[0][1].........,m[9][9].
2D Array Initialization
int m[2][3] = {{10,15,20},{20,14,25}};
Total bytes = No. of rows * No. of columns * Size of datatype
Total bytes = 2*3*2 = 12
Sample Programs
C program to input 2 matrices and find the sum of matrices.
C program to input 2 matrices and find the difference of two matrices.
C program to input 2 matrices and find the multiplication of matrices.
Top Questions
What is the function of git rm?
Differences between GET and POST
How to create and load view in codigniter?
SQL Joins
What is the function of git diff in git?
Data Types in C
Understanding the Attributes in HTML
What is Yii Framework | Advantages of Yii over other frameworks | Different versions of Yii
BASIC HTML PAGE
Switch Statement In C Programming
Functions in PHP
REST API in Laravel
Before Beginning Of Programming, Why C First? And Why Programming And Programmers
What are sessions in PHP?
How to Get current version of PHP?
While loop in C
DO WHILE LOOP in C Programming
Generating A QR Code With PHP
Algorithm | Algorithm Design Techniques
Break Statement In C
Tex AI Assistant
Online & ready to help
×
Hi! 👋 I'm your Texinterest AI assistant.
Ask me anything about programming, interview prep, courses, or any topic you're studying.
Press Enter to send · Powered by Gemini AI