🔹 1.
Grid Printer
Ask the user for a number n and print a square grid of * with size n × n.
Example:
Input: 3
Output:
***
***
Hint: Use two loops — one for rows and one for columns.
🔹 2. Addition Table
Ask the user for a number n. Print a table where each cell shows the sum of
the row and column numbers (starting from 1).
Example (n=3):
234
345
456
Hint: Outer loop for rows, inner loop for columns.
🔹 3. Triangle Pattern
Ask the user for a number and print a right-angled triangle of numbers.
Example (input 5):
1
22
333
4444
55555
Hint: Nested loops — outer for lines, inner for repeating the number.
🔹 4. Character Matrix
Take a word from the user and print each character in a grid where each row
is the whole word.
Example (input Dog):
Dog
Dog
Dog
Hint: Outer loop runs as many times as the length of the word; inner loop
prints the word.
🔹 5. Multiplication Chart
Print a multiplication chart from 1 to 5 using nested loops (rows and
columns).
Example Output:
1x1=1 1x2=2 1x3=3 …
2x1=2 2x2=4 2x3=6 …
…
Hint: Nested loops make a table.