VOOZH about

URL: https://www.geeksforgeeks.org/dsa/natural-numbers/

⇱ Program to Print First N Natural Numbers - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program to Print First N Natural Numbers

Last Updated : 11 Jul, 2025

Counting numbers like 1, 2, 3, 4, 5, 6 … Basically, all integers greater than 0 are natural numbers. 

👁 Image

Facts about Natural numbers 

  1. The natural numbers are the ordinary numbers, 1, 2, 3, etc., with which we count.
  2. The next possible natural number can be found by adding 1 to the current natural number
  3. The number zero is sometimes considered to be a natural number. Not always because no one counts starting with zero, 0, 1, 2, 3.
  4. GCD of all other natural numbers with a prime is always one.
  5. The natural numbers can be defined formally by relating them to sets. Then, zero is the number of elements in the empty set; 1 is the number of elements in the set containing one natural number; and so on.

Iterative Approach


Output
1 2 3 4 5 6 7 8 9 10 

Time Complexity: O(n)
Auxiliary Space: O(1)

Recursive Approach


Output
1 2 3 4 5 6 7 8 9 10 

Time Complexity: O(n)
Auxiliary Space: O(n)

More problems related to Natural Number: 

Comment
Article Tags:
Article Tags: