Assignment #111
Code
/*
jack newsom
period 5
program NestingLoops
filename NestingLoops.java
date completed 11/12/2015
*/
public class NestingLoops
{
public static void main( String[] args )
{
// this is #1 - I'll call it "CN"
// n changes faster
for ( int n=1; n <= 3; n++ )
{
for ( char c='A'; c <= 'E'; c++ )
{
System.out.println( c + " " + n );
}
}
System.out.println("\n");
// this is #2 - I'll call it "AB"
for ( int a=1; a <= 3; a++ )
{
for ( int b=1; b <= 3; b++ )
{
System.out.print( a + "-" + b + " " );
}
System.out.println();
}
System.out.println("\n");
}
}
Picture of the output