-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPP4062.java
More file actions
executable file
·40 lines (34 loc) · 961 Bytes
/
Copy pathPP4062.java
File metadata and controls
executable file
·40 lines (34 loc) · 961 Bytes
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
//**************************************************************************
// PP406 Produces a multiplication table, showing the results of multiplying
// the integers 1 through 12 by themselves.
//**************************************************************************
import java.text.NumberFormat;
public class PP4062
{
public static void main(String[] args)
{
System.out.print("\t|");
for (int i = 1; i <=12; i++)
{
System.out.print(i + "\t");
}
System.out.println();
for (int i = 1; i <= 100; i++)
{
if (i == 9)
System.out.print("+");
else
System.out.print("-");
}
System.out.println("\t|");
for (int i = 1; i <= 12; i++)
{
System.out.println();
System.out.print(i + "\t|");
for (int j = 1; j <= 12; j++)
{
System.out.print(i*j + "\t");
}
}
}
}