THINK FIRST·CODE LATER

← All labs

Multiplication table

Problem

Write a class Multiplication that prints the multiplication table from 1 to 9 as a neat grid, using nested loops.

Each number must be printed in a field of 4 characters (printf("%4d", ...)), and each row on its own line. The first row starts with 1 2 3 ….

Write it here or in your IDE, then paste it. Compile and test it yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.