Skip to content

Instantly share code, notes, and snippets.

@h2rashee
Created October 11, 2015 01:01
Show Gist options
  • Save h2rashee/aa78c1f11c70269f7da0 to your computer and use it in GitHub Desktop.
Save h2rashee/aa78c1f11c70269f7da0 to your computer and use it in GitHub Desktop.
Multiplication table
class Multiply
{
public static void main (String [] args)
{
int base = 12;
// List style
for(int i = 1; i <= base; i++) {
for(int j = 1; j <= base; j++) {
System.out.println(i + " x " + j + ": " + i*j);
}
}
// Table style
for(int i = 1; i <= base; i++) {
for(int j = 1; j <= base; j++) {
System.out.print(i*j + " ");
}
System.out.println();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment