public class Loops
{
  public static void main( String[] args )
  {
    // while loop

    int cnt = 12;

    while ( cnt > 0 )
    {
      System.out.println( cnt );
      cnt--;
    }

    // do-while loop

    int pos = 1;
    do
    {
      System.out.println( pos );
      pos++;
    } while ( pos <= 10 );

    // for loop

    for ( int i = 1; i < 11; i++ )
      // i loop counter
      System.out.println( i );
    
    for ( int i = 1, j = 9; i <= j; i++, j-- )
      System.out.printf( "%d * %d = %d%n", i, j, i*j );

  }
}