View Single Post
Old 06-11-2007, 07:51 AM   #375 (permalink)
Gigacore
Dreamweaver
 
Gigacore's Avatar
 
Join Date: Aug 2006
Location: Bangalore
Posts: 3,904
Default Re: Post ur C/C++ Programs Here

A C Program to find the sum of two matrix using two dimensional array.

Code:
#include <stdio.h>
#include<conio.h>
void main()
{
	int a[10][10],b[10][10],c[10][10];
	int i,j,n,m;
	printf("Enter the order of matrix:);
	scanf("%d%d",&n,&m);
	printf("Enter the elements of matrix")
	for(i=0;i<n;i++)
	for(j=0;j<n;j++)
	scanf("%d",&b[i][j]);
	for(i=0;i<n;i++)
	{
	for(j=0;j<m;j++)
	{
	c[i][j]=a[i][j]+b[i][j];
	}
	}
	printf("Addition of matrices");
	for(i=0;i<n;i++)
	{
	for(j=0;j<n;j++)
	{
	printf("%d\t",c[i][j]);
	}
	printf("\n");
	}
	getch();
	return(0);
getch();
}
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore

Follow me on twitter.com/gigacore

Last edited by Gigacore; 06-11-2007 at 08:49 AM.
Gigacore is offline