// NestedLoopEx3.java
// Aaron Tan
// Trace this program and determine the output without running it.

class NestedLoopEx3 {
 
  public static void main(String[] args) {

    for (int p=0; p<10; p++) {

      if (p%2 == 0) {
        for (int q=4; q>0; q--) 
          System.out.println("p = " + p + ", q = " + q);
      }
      else {
        for (int q=p; q<20; q+=5) 
          System.out.println("p = " + p + ", q = " + q);
      }

    }

  }

}


