Sunday, December 6, 2026
Latest:
  • Präsentation für b1
  • Verb “werden” Konjugation
  • In German, verb sein (to be) Konjunktion
  • Wichtige wörter für B1 prüfung
  • What are the main differences between ApplicationContext and BeanFactory?
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

Template method design pattern

March 6, 2023 beroza

Bitwise operators JavaScript

June 8, 2022 beroza

TypeError: Cannot read property ‘setState’ of undefined ReactJS

March 3, 2020 beroza

How to empty a file in linux?

May 17, 2019 beroza

The following SDK component was not installed: sys-img-x86-addon-google_apis-google-21

December 4, 2018 beroza

Remove a trailing slash from a string (i.e. string) in java

December 10, 2019 beroza

TypeError: Cannot assign to read only property of object ‘#Object’ reactjs

April 15, 2019 beroza

How to uninstall or remove apache2 using command line?

July 15, 2021 beroza

Useful linux find command that developer should know

March 9, 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.