We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6888771 commit 7395f91Copy full SHA for 7395f91
30 Days JavaScript Challenge/7-Day.js
@@ -0,0 +1,13 @@
1
+// Define a function that takes a number parameter
2
+function multiplicationTable(number) {
3
+ // Use a for loop to iterate from 1 to 10
4
+ for (let i = 1; i <= 10; i++) {
5
+ // Multiply the number with the current iterator and store the result in a variable
6
+ let result = number * i;
7
+ // Print the multiplication table for the given number
8
+ console.log(`${number} x ${i} = ${result}`);
9
+ }
10
11
+
12
+ // Call the function with a test case to see the output
13
+ multiplicationTable(5);
0 commit comments