Tag Archives: Matrix

C program to multiply two matrix using pointers

Write a C program to multiply two matrix using pointers. How to input and multiply two matrix using pointer in C programming. Logic to multiply two matrix using pointer in C.

Example

Input

Input elements of matrix1:
10 20 30
40 50 60
70 80 90
Input elements of matrix2:
1 2 3
4 5 6
7 8 9

Output

Product of matrices is :
300 360 420
660 810 960
1020 1260 1500

Continue reading C program to multiply two matrix using pointers

How to access two dimensional array using pointers in C programming?

How to access two dimensional array using pointers in C programming? Write a C program to input and print elements of a two dimensional array using pointers and functions.

Example

Input

Input elements in 3x3 matrix: 
1 2 3
4 5 6
7 8 9

Output

Elements of 3x3 matrix: 
1 2 3
4 5 6
7 8 9

Continue reading How to access two dimensional array using pointers in C programming?

Multi-dimensional array in C – Declare, initialize and access

Multi-dimensional array is an array of array or more precisely collection of array. Unlike one-dimensional array, multi-dimensional array stores collection of array.

Let us revise the concept of dimension.

  • One-dimensional array : Collection of data/values.
  • Two-dimensional array : Collection of one-dimensional array.
  • Three-dimensional array : Collection of two-dimensional array.
  • N-dimensional array : Collection of N-1 dimensional array.

Continue reading Multi-dimensional array in C – Declare, initialize and access