Learning to print numbers from 1 to 100 is a fundamental skill in programming. This simple task helps beginners understand the basics of loops and conditional statements. In this article, we'll explore different ways to achieve this in several popular programming languages.

Before we dive into the code, let's understand the problem. We want to output the numbers from 1 to 100, one per line. That's it! Now, let's see how we can do this.

Using Loops
Loops are the workhorses of programming. They allow us to repeat a block of code multiple times. In this case, we'll use a loop to print the numbers from 1 to 100.

Let's look at how we can do this in a few languages.
Python

Python's `range()` function makes this task a breeze. You can simply loop through the numbers in the range using a `for` loop.
Code: ```python for i in range(1, 101): print(i) ```
JavaScript

JavaScript also provides the `for` loop, but we'll use a while loop here to demonstrate its usage.
Code: ```javascript let i = 1; while (i <= 100) { console.log(i); i++; } ```
Using Recursion

Recursion is a more advanced topic where a function calls itself to solve a problem. While loops are more efficient for this task, it's interesting to see how we can print numbers using recursion.
Let's look at a recursive solution in JavaScript.


![Free Printable Number Flashcards 1-100 with Words [PDF Included] - Number Dyslexia](https://i.pinimg.com/originals/7f/c3/4b/7fc34b23f35ba95b375f572d0c5a8def.jpg)







Recursive Solution
In this recursive approach, we define a function `printNumbers` that calls itself with the next number until it reaches 101 (our stopping condition).
Code: ```javascript function printNumbers(n) { if (n <= 100) { console.log(n); printNumbers(n + 1); } } printNumbers(1); ```
As you can see, printing numbers from 1 to 100 can be achieved in multiple ways depending on the language and your preferred programming style. Whether you're using loops or recursion, the key is to understand the problem and apply the appropriate algorithm. Now that you've mastered this basic task, you're ready to venture into more complex coding challenges.