Assignment # 114 and Multiplication Table
Code
/// Name: Tommy Oyuntseren
/// Period: 7
/// Program Name: MultiplicationTable
/// File Name: MultiplicationTable.java
/// Date: 5/5/16
public class MultiplicationTable
{
public static void main(String[] args)
{
System.out.println(" x | 1 2 3 4 5 6 7 8 9");
System.out.println( "===+====================================================");
for (int x=1; x<=12; x++)
{
if (x < 10)
System.out.print(" ");
System.out.print(x+ " | ");
for ( int y=1; y<=9; y++ )
{
System.out.print((x*y)+ " ");
if ((x*y) < 10)
System.out.print(" ");
}
System.out.println();
}
}
}
Picture of the output