NextIndexPrevious

Programs in C language

16. Program to find Difference of two matrices.
#include<stdio.h>

void main()
{
	int a[3][3], b[3][3], i, j;
    clrscr();
    printf("Enter values for Matrix A:");
    for(i=0;i<3;i++)
    for(j=0;j<3;j++)
    scanf("%d",&a[i][j]);
    
    printf("Enter values for Matrix B:");
    for(i=0;i<3;i++)
    for(j=0;j<3;j++)
    scanf("%d",&b[i][j]);
    
    printf("The result matrix:");
    for(i=0;i<3;i++)
    {
		printf("\n");
	    for(j=0;j<3;j++)
    	scanf("%5d",a[i][j]-b[i][j]);
     }
    
    getch();
}




Father of C Language
Dennis Ritchie

Dennis Ritchie

Born: September 9, 1941, Bronxville
Died: October 9, 2011, Murray Hill