Matrix Addition In C Programming Tamil


#include<stdio.h>
#include<conio.h>
void main()
{
	int a[20][20],b[20][20];
	int r,c,i,j;
	clrscr();
	printf("Enter the rows:");
	scanf("%d",&r);
	printf("Enter the col:");
	scanf("%d",&c);
	printf("Enter the value of matrix A:");
	for(i=0;i<r;i++)
	{

		for(j=0;j<c;j++)
		{
			printf("Enter the value of a[%d][%d]",i,j);
			scanf("%d",&a[i][j]);
		}
	}
	printf("Enter the value of matrix B:");
	for(i=0;i<r;i++)
	{

		for(j=0;j<c;j++)
		{
			printf("Enter the value of b[%d][%d]",i,j);
			scanf("%d",&b[i][j]);
		}
	}
	printf("\n TOtal matrix:\n");
	for(i=0;i<r;i++)
	{
		for(j=0;j<c;j++)
		{
			printf("\t %d", (a[i][j])+b[i][j]);
		}
		printf("\n");
	}
	getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming