-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path54_Array3.java
More file actions
64 lines (58 loc) · 1.1 KB
/
54_Array3.java
File metadata and controls
64 lines (58 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Program of 2-Diamensional Array
*/
package javaprograms;
/**
*
* @author Geeky Keshav
*/
public class Array3
{
public static void main(String [] args)
{
int a[] []=new int [3][3];
int b[] []=new int [3][3];
int c[][]=new int [3][3];
for(int i=0;i<3;i++)
{
for (int j=0;j<3;j++)
{
a[i][j]=4*(j+1);
}
}
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
b[i][j]=5*(j+1);
}
}
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
c[i][j]=a[i][j]+b[i][j];
}
}
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
System.out.println("\t"+c[i][j]);
}
System.out.println("\n");
}
}
}
/*****OUTPUT****
run:
9
18
27
9
18
27
9
18
27
*/