Sunday, April 26, 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

What are different methods of JavaScript promises?

April 6, 2021 beroza

How to pass data from child component to parent in ReactJS?

August 15, 2021 beroza

How to support multiple languages in ReactJS application?

March 9, 2020 beroza

kubectl useful commands that developers should know.

April 14, 2020 beroza

dyld: Library not loaded, Referenced from: Reason: image not found

May 20, 2020 beroza

How to get last Monday or last Friday or any last day in JavaScript?

April 20, 2021 beroza

What are the differences between application server and a servlet container?

November 25, 2019 beroza

Reset form fields, set of fields using jQuery

December 11, 2018 beroza

Useful Java basic tips for developers

February 26, 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.