User:Chinu.jangu

bluej java program for addition of two matrix:-

import java.util.*;

public class sum_of_array

{

public static void main

{

int a[][]=new int[3][3];

int b[][]=new int[3][3];

int c[][]=new int[3][3];

Scanner sc=new Scanner(System.in);

System.out.println("enter the matrix elements row wise");

for(int x=0;x<3;x++)

{

for(int z=0;z<3;z++)

{

a[x][z]=sc.nextInt;

}}

System.out.println("enter the elements of another matrix");

for(int x=0;x<3;x++)

{

for(int z=0;z<3;z++)

{

b[x][z]=sc.nextInt;

}}

for(int x=0;x<3;x++)

{

for(int z=0;z<3;z++)

{

c[x][z]=a[x][z]+b[x][z];

System.out.print(c[x][z]+" ");

}

System.out.println;

}}}

created by:- chinu jangu

studing in :-Xth class in St.kabir school