Created
October 11, 2015 01:01
-
-
Save h2rashee/aa78c1f11c70269f7da0 to your computer and use it in GitHub Desktop.
Multiplication table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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