Thursday, January 29, 2026
Latest:
  • 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?
  • How Spring framework resolves circular dependencies?
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

Should we write a lot of code inside finally block?

June 22, 2023 beroza

Next.js interview questions

December 16, 2021 beroza

What are the benefits of Docker containers?

July 18, 2019 beroza

How Jenkins X works with Kubernetes using PROW and Tekton?

May 13, 2020 beroza

Write a program to remove palindromic subsequences from string

June 16, 2022 beroza

Difference between a node module and a package in Node.js?

January 4, 2022 beroza

How to uninstall android studio from Ubuntu 16.04 or 18.04?

December 4, 2018 beroza
infoguard

What is VPN? How does VPN work? What are the benefits of VPN?

July 11, 2021 Sourav Paul

What are the differences between Map vs Object in JavaScript?

August 30, 2021 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.