Assignment #114
Code
///Name: Matthew Lorence
///Period: 5
public class Timestable
{
public static void main( String[] args )
{
int counter = 0;
int product;
System.out.println("x |\t1\t2\t3\t4\t5\t6\t7\t8\t9");
System.out.println("==+==========================================================================");
for ( int y = 1; y <= 12; y = y + 1 )
{
counter++;
for ( int x = 1; x <= 9; x = x + 1 )
{
product = x*y;
if ( product == y )
System.out.print( y + " |" );
System.out.print("\t" + product );
}
System.out.println();
}
}
}
Picture of the output