Sunday, October 12, 2025
Latest:
  • German Pronouns with Nominative, Accusative, and Dative cases
  • German articles for the nominative, accusative, and dative cases
  • Der kleine Vogel und die Sonne
  • German alphabet pronunciation
  • Command design pattern
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

How to add multiple language support in ReactJS with i18next and react-i18next?

September 30, 2020 beroza

How to create a dialog or popup using CSS?

June 9, 2022 beroza

Find First and Last Position of Element in Sorted Array

January 29, 2023 beroza

Override clone judiciously in java

February 5, 2020 beroza

Wikipedia is full of quality information, please donate

January 23, 2019 beroza

What are the differences between Call, Apply and Bind in JavaScript?

August 30, 2021 beroza

How to pass an event to parent DOM from Iframe using JavaScript?

November 29, 2020 beroza

Write a Program to Reformat The String

January 10, 2023 beroza

Write a Program to Find Island Perimeter

January 15, 2023 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 © 2025 Upokary. All rights reserved.