import java.io.FileWriter; import java.io.IOException; public class NestedLoops { public static void main(String[] args) throws IOException { FileWriter writer = new FileWriter("C:/Temp/outFile.txt"); int product; for (int row = 1; row < 6; row++) { for (int col = 1; col < 6; col++) { product = row * col; writer.write(product + " "); } writer.write("\n"); } writer.close(); } }