Created
August 8, 2019 23:37
-
-
Save parzibyte/8ea500f7ebc68a24ac459e47ffc12518 to your computer and use it in GitHub Desktop.
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
/* | |
Tablas de multiplicar en Java hasta el 100 | |
https://parzibyte.me/blog | |
*/ | |
class Main { | |
public static void main(String[] args) { | |
int numeroTabla = 9; // La tabla del nueve | |
imprimirTabla(numeroTabla); | |
} | |
public static void imprimirTabla(int numeroDeTabla) { | |
for (int x = 1; x <= 100; x++) { | |
String formato = "%d x %d = %d"; | |
String linea = String.format(formato, numeroDeTabla, x, numeroDeTabla * x); | |
System.out.println(linea); | |
} | |
} | |
} | |
/* | |
Salida: | |
9 x 1 = 9 | |
9 x 2 = 18 | |
9 x 3 = 27 | |
9 x 4 = 36 | |
9 x 5 = 45 | |
9 x 6 = 54 | |
9 x 7 = 63 | |
9 x 8 = 72 | |
9 x 9 = 81 | |
9 x 10 = 90 | |
9 x 11 = 99 | |
9 x 12 = 108 | |
9 x 13 = 117 | |
9 x 14 = 126 | |
9 x 15 = 135 | |
9 x 16 = 144 | |
9 x 17 = 153 | |
9 x 18 = 162 | |
9 x 19 = 171 | |
9 x 20 = 180 | |
9 x 21 = 189 | |
9 x 22 = 198 | |
9 x 23 = 207 | |
9 x 24 = 216 | |
9 x 25 = 225 | |
9 x 26 = 234 | |
9 x 27 = 243 | |
9 x 28 = 252 | |
9 x 29 = 261 | |
9 x 30 = 270 | |
9 x 31 = 279 | |
9 x 32 = 288 | |
9 x 33 = 297 | |
9 x 34 = 306 | |
9 x 35 = 315 | |
9 x 36 = 324 | |
9 x 37 = 333 | |
9 x 38 = 342 | |
9 x 39 = 351 | |
9 x 40 = 360 | |
9 x 41 = 369 | |
9 x 42 = 378 | |
9 x 43 = 387 | |
9 x 44 = 396 | |
9 x 45 = 405 | |
9 x 46 = 414 | |
9 x 47 = 423 | |
9 x 48 = 432 | |
9 x 49 = 441 | |
9 x 50 = 450 | |
9 x 51 = 459 | |
9 x 52 = 468 | |
9 x 53 = 477 | |
9 x 54 = 486 | |
9 x 55 = 495 | |
9 x 56 = 504 | |
9 x 57 = 513 | |
9 x 58 = 522 | |
9 x 59 = 531 | |
9 x 60 = 540 | |
9 x 61 = 549 | |
9 x 62 = 558 | |
9 x 63 = 567 | |
9 x 64 = 576 | |
9 x 65 = 585 | |
9 x 66 = 594 | |
9 x 67 = 603 | |
9 x 68 = 612 | |
9 x 69 = 621 | |
9 x 70 = 630 | |
9 x 71 = 639 | |
9 x 72 = 648 | |
9 x 73 = 657 | |
9 x 74 = 666 | |
9 x 75 = 675 | |
9 x 76 = 684 | |
9 x 77 = 693 | |
9 x 78 = 702 | |
9 x 79 = 711 | |
9 x 80 = 720 | |
9 x 81 = 729 | |
9 x 82 = 738 | |
9 x 83 = 747 | |
9 x 84 = 756 | |
9 x 85 = 765 | |
9 x 86 = 774 | |
9 x 87 = 783 | |
9 x 88 = 792 | |
9 x 89 = 801 | |
9 x 90 = 810 | |
9 x 91 = 819 | |
9 x 92 = 828 | |
9 x 93 = 837 | |
9 x 94 = 846 | |
9 x 95 = 855 | |
9 x 96 = 864 | |
9 x 97 = 873 | |
9 x 98 = 882 | |
9 x 99 = 891 | |
9 x 100 = 900 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment