Found 1 Questions For Campus Interview

How to Print Numbers From 1 to 100 Without Using a Loop {while, do while, for}?

Updated on 26-Mar-2024 17:13:30
  In the realm of programming, there's often more than one way to accomplish a task. When it comes to printing numbers from 1 to 100 without using traditional loops like `for`, `while`, or `do while`, creativity and ingenuity come into play. In this article, we'll delve into three distinct methods to achieve this goal using C, C++, Java, PHP, and Python. Method 1: Recursion Recursion, a powerful concept in programming, can be harnessed to print numbers from 1 to 100 without a loop. I... Read Mores



Advertisements

ads