title: Finding pentagonal numbers and printing them 10 by 10
body: <p>I have a code to find the <a href="https://en.wikipedia.org/wiki/Pentagonal_number" rel="nofollow">pentagonal numbers</a> and print them 10 by 10. However I cannot figure out how to print the pentagonal numbers out other than the final value.</p>
  
  <pre><code>public class Lab_6_1{
     public static void main (String[] args){
  
  
    System.out.println("Pentagonal Numbers are: ");
    getPentagonalNumber(100);
     }
  
     public static int getPentagonalNumber(int n){
  
  
    int pentNum=((n*(3*n-1))/2);
    final int numPerLine=10;
  
    for(n=1;n&lt;=100;n++)
    {
    System.out.print(" "+n);
    if (n % 10==0)
    System.out.print("\n");
    }
    System.out.print(pentNum);
    return pentNum;
  
  
     }
  }
  </code></pre>
  
  <p>I don't want blatant answers. Just advice and/or hints to figure it out.</p>