Sieve of Eratosthenes

The name seems to be threatening right? On the contrary, Sieve of Eratosthenes is a technique developed by one of the brilliant Greek Mathematicians, Eratosthenes, to eliminate complex looping multiplications or divisions. This algorithm removes all the numbers that do not meet a specific criterion, hence works like a sieve. This is one of the … Read more

Count Digits in a Number

In this article we will discuss four methods to count the digits in a given number. The codes provided will be in C++, but same logic can be used to implement in any other language. Iterative Solution to Count Digits in a Number This method uses division operation(/) to pluck the digits from a number, … Read more