Thursday, June 25, 2026
Latest:
  • In German, verb sein (to be) Konjunktion
  • Wichtige wörter für B1 prüfung
  • What are the main differences between ApplicationContext and BeanFactory?
  • German B1 Word list
  • How does Lazy annotation work in Spring?
Upokary

Upokary

Quality information

  • Health
  • Life
  • Fashion
  • Food
  • Code
  • English
  • বাংলা
Technology 

Write a program to print first 50 natural numbers using recursion.

Published: November 1, 2022 recursion

The following code will print the first 50 natural numbers using recursion:

    const printNumber = (num) => {
       if (num < 1) {
          return 1;
       }

       printNumber(num -1);
       console.log(num);
       return num;
    };

    printNumber(5)

You May Also Like

When to use Queue data structure?

January 6, 2023 beroza

Fibonacci Series

December 20, 2023 beroza

Permission denied for database “postgres”, User does not have CONNECT privilege.

June 1, 2020 beroza

How to install or setup WordPress multisite?

December 4, 2019 beroza

Write a Program to Find Most Common Word

January 14, 2023 beroza

Find the segmented input string into the words of a given dictionary.

February 10, 2022 beroza

Write a Program to Find Island Perimeter

January 15, 2023 beroza

Calculate the sum of numbers from 1 to n using recursion

June 17, 2023 beroza

How to switch PHP versions for apache2 and command line?

May 15, 2019 beroza

Why Upokary?

Upokary.com is a useful application in everyday life. It provides very handy information regarding every aspect of life. Each and every tip of upokary.com is meant to make life better.

Upokary tools

  • Youtube thumbnail
  • Youtube video downloader

Useful Links

  • Handy code
  • Technology
  • People
  • Programming
  • Quote
  • Travel
  • WordPress
  • IELTS
  • Kids

Pages

  • Sitemap
  • Privacy policy
  • About us
  • Contact us

Support

For any kind of query or question please drop a message in the following email: upokary@gmail.com
Copyright © 2026 Upokary. All rights reserved.