# jituTechnology

Codes
/*A program to sort the data in ascending order using function*/
10116
22 Mar,2011*/
#include<stdio.h>
#include<conio.h>
void display(int matrix[][20],int,int);
main()
{
int matrix1[20][20];
int matrix2[20][20];
int row1,row2,col1,col2;
printf(“Enter the dimension of matrix 1:\n”);
scanf(“%d%d”,&row1,&col1);
printf(“Enter the dimension of matrix 2:\n”);
scanf(“%d%d”,&row2,&col2);
getch();
}
{
int i,j;
printf(“Enter the elements of matrix:\n”);
for(i=0;i<row;i++)
for(j=0;j<col;j++)
scanf(“%d”,&matrix[i][j]);
}
void add(int matrix1[][20],int matrix2[][20],int row,int col)
{
int matrix[20][20];
int i, j;
for(i=0;i<row;i++)
for(j=0;j<col;j++)
matrix[i][j]=matrix1[i][j]+matrix2[i][j];
display(matrix,row,col);
}
void display(int matrix[][20],int row,int col)
{
int i,j;
printf(“The sum of two matrix is:”);
for(i=0;i<row;i++)
{
printf(“\n”);
for(j=0;j<col;j++)
printf(“%d\t”,matrix[i][j]);
}
printf(“\n\n”);
printf(“Press any key to continue…”);
}
Output
Enter the dimension of matrix 1:
2
2
Enter the dimension of matrix 2:
2
2
Enter the elements of matrix:
1
2
3
4
Enter the elements of matrix:
4
3
2
1
The sum of two matrix is:
5          5
5          5

Press any key to continue…

This site uses Akismet to reduce spam. Learn how your comment data is processed.

### Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800