Posted By

joshnunn on 08/27/09


Tagged

class java simple iteration loop for


Versions (?)

Simple Times Table Generator


 / Published in: Java
 

Adapted the simple code the lecturer was using to generate a times table, just to see if I "got" the concept properly.

  1. public class Main {
  2.  
  3. /**
  4.   * @param args the command line arguments
  5.   */
  6. public static void main(String[] args) {
  7. int x,y;
  8. for (x = 1; x <= 12 ; x++){
  9. for (y = 1; y <= 12 ; y++){
  10. System.out.println(x + " x " + y + " = " +(x*y));
  11. }
  12. }
  13. }
  14.  
  15. }

Report this snippet  

You need to login to post a comment.