# What is Egyptian fraction problem? Trick to print 1–100 numbers without any loop, function or recursion.

This article contains information about what is Egyptian fraction problem and how to solve it in C++ language. Also, a simple trick to print numbers from 1–100 without any control statement or function. Let’s get started.

What is Egyptian fraction problem?

An Egyptian fraction is a finite sum of distinct unit fractions in such a way that each fraction is unit fraction if numerator is “1” and denominator is any positive integer.
Example ::
For 3/5, Egyptian fraction can be represented as 1/2 + 1/10

Back in 2000 B.C., the Egyptians had developed their fraction system for mathematical division and calculation for any rational numbers. if a cylindrical bucket has 3/5​ of water full, we can understand that by dividing the bucket into 5 equal heights, the water level will reach the brim of such 3 heights. However, for the Egyptians, other numerators apart from 1 were simply inconsistent with their algorithm. Instead, they would see such volume as half a bucket full of water plus one-tenth of that, for 1/2 + 1/10 = 3/5.

Note ::
i} Number should be positive
ii} Numerator should be less than denominator

Approach to solve this problem

This problem can be solved in multiple ways like using array or recursion as well. I am gonna solve it using “3 variables” and one in-built function “ceil()”.

Steps ::
I} Create a class (user-defined datatype) with two properties i.e. numerator and denominator.
II} Declare variables in “double” datatype for accurate result
III} Solve expression until numerator is not “zero”
IV} Before any operation, check if numerator is less than denominator or not

Trick to print 1–100 numbers without any function/in-built function or loop
Programming is all about how you develop logic and try out different things in it. We all know, 1–100 numbers can be easily printed out using loop or recursion but, without these, there is also a way to do so.