Menu
Coddy logo textTech

Multiplication Table

Lesson 14 of 25 in Coddy's Coding Problems: Volume 2 course.

You will be given a single number and your task is to print out the multiplication table up to that number

 123456
1123456
224681012
3369121518
44812162024
551015202530
661218243036
challenge icon

Challenge

Medium

Write a program that from standard input reads a natural number N (N < 100) and prints out the multiplication table up to that number, print out 3 spaces between each number and 4 spaces in the beginning of the first row

Input
5

Output
     1   2   3   4   5
1   1   2   3   4   5
2   2   4   6   8   10
3   3   6   9   12   15
4   4   8   12   16   20
5   5   10   15   20   25

Try it yourself

#include <stdio.h>

int main() {
    // Write code here
    return 0;
}

All lessons in Coding Problems: Volume 2