Skip to content

Instantly share code, notes, and snippets.

@viveknarang
Created September 27, 2017 02:39
Show Gist options
  • Save viveknarang/3ccfb7fd3c3b0ec8f04762c0fc83e741 to your computer and use it in GitHub Desktop.
Save viveknarang/3ccfb7fd3c3b0ec8f04762c0fc83e741 to your computer and use it in GitHub Desktop.
public class NestedLoops {
public static void main (String [] args) {
int numRows = 2;
int numCols = 3;
// Note: You'll need to declare more variables
/* Your solution goes here */
for (int i = 1 ; i <= numRows; i++) {
for(int j = 1 ; j <= numCols; j++) {
System.out.print(i + "" +(char)(j + 64) + " ");
}
}
System.out.println("");
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment