From e1bb4c894213060301494e6e9a6a77f2e867df5b Mon Sep 17 00:00:00 2001 From: ankitanmol <48329937+ankitanmol@users.noreply.github.com> Date: Mon, 14 Oct 2019 11:44:18 +0530 Subject: [PATCH] Create EgyptianFractions.py --- EgyptianFractions.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 EgyptianFractions.py diff --git a/EgyptianFractions.py b/EgyptianFractions.py new file mode 100644 index 0000000..2cb879c --- /dev/null +++ b/EgyptianFractions.py @@ -0,0 +1,20 @@ +import math +x = 2 +add = 0 +a = int(input("Enter Numerator: ")) +b = int(input("Enter Denomenator: ")) + +c = a/b +temp = c + +print(c) +print("Output: 0") +while(add!=c): + if((1/x)<=temp): + add=add+(1/x) + temp=c-add + print("+1/", x) + x=x+1 + + +print(add)