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
| 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | 5 | 6 |
| 2 | 2 | 4 | 6 | 8 | 10 | 12 |
| 3 | 3 | 6 | 9 | 12 | 15 | 18 |
| 4 | 4 | 8 | 12 | 16 | 20 | 24 |
| 5 | 5 | 10 | 15 | 20 | 25 | 30 |
| 6 | 6 | 12 | 18 | 24 | 30 | 36 |
Challenge
MediumWrite 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
1Course Introduction
Introduction3Medium Difficulty
NumbersPositionsEncryptionMultiplication TableSmall Large PalindromeBingoGreatest DivisorsArt