Friday, May 9, 2025
Latest:
  • Der kleine Vogel und die Sonne
  • German alphabet pronunciation
  • Command design pattern
  • German words with gender
  • When to use einen and keinen in German?
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, 2022recursion

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

AWS IAM error : ‘Your authentication information is incorrect. Please try again’

October 25, 2019 beroza

When we should use StringBuilder over String concatenation in Java?

May 23, 2020 beroza

Difference between Arrays.asList(array) and new ArrayList(Arrays.asList(array)) in Java

May 26, 2020 beroza

Always override hashcode when you override equals

February 5, 2020 beroza

How to switch java versions in Mac OS?

July 30, 2019 beroza

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

June 1, 2020 beroza

Bitwise XOR related programming problems

May 31, 2023 beroza

State Design Pattern

December 25, 2022 beroza

Write a program to check if number has equal digit count and digit value

June 19, 2022 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

Languages

  • EnglishEnglish
  • বাংলাবাংলা

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.