Input:
Enter 5 elements in the array: 23 45 32 25 45
Output:
Element in the array are:
Element stored at a[0]:23
Element stored at a[0]:45
Element stored at a[0]:32
Element stored at a[0]:25
Element stored at a[0]:45
Multidimensional Array program:
#include<stdio.h>
int main()
{
int r,c,a[50][50],b[50][50],sum[50][50],i,j;
printf("\t\n Multi-dimensional array");
printf("\n Enter the row matrix:");
scanf("%d",&r);
printf("\n Enter the col matrix:");
scanf("%d",&c);
printf("\n Element of A matrix");
for(i=0;i<r;++i)
for(j=0;j<c;++j)
{
printf("\n a[%d][%d]:",i+1,j+1);
scanf("%d",&a[i][j]);
}
printf("\n Element of B matrix");
for(i=0;i<r;++i)
for(j=0;j<c;++j)
{
printf("\n b[%d][%d]:",i+1,j+1);
scanf("%d",&b[i][j]);
}
printf("\n Addition of matrix");
for(i=0;i<r; i++)