-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# program to find out EMI using formula | ||
# EMI = (p*r(1+r)**t)/((1+r)**t-1) | ||
# made by : rakesh kumar | ||
|
||
from math import pow | ||
|
||
|
||
def emi_calculate(p, r, t): | ||
r = r/(12*100) # rate for one month | ||
t = t*12 # one month time | ||
emi = (p*r*pow(1+r, t))/(pow(1+r, t)-1) | ||
return emi | ||
|
||
|
||
if __name__ == "__main__": | ||
p = int(input('Enter pricipal amount :')) | ||
r = int(input('Enter rate of interest :')) | ||
t = int(input('Enter time in years :')) | ||
emi = emi_calculate(p, r, t) | ||
|
||
print('Monthly Installment :%.2f' % emi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# program to find out GCD of two number using iterative method | ||
# made by : rakeseh kumar | ||
|
||
|
||
a = int(input('Enter any number')) | ||
b = int(input('Enter another number')) | ||
|
||
""" if(a > b): | ||
number = a | ||
divider = b | ||
else: | ||
number = b | ||
divider = a """ | ||
|
||
rem = a % b | ||
|
||
while(rem != 0): | ||
a = b | ||
b = rem | ||
rem = a % b | ||
|
||
print('Your GCD is :', b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
r = int(input('Enter rate of interest amount :')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
def gcd(a, b): | ||
if(b == 0): | ||
return a | ||
else: | ||
return gcd(b, a % b) | ||
|
||
|
||
if __name__ == "__main__": | ||
a = int(input('Enter first number ')) | ||
b = int(input('Enter second number ')) | ||
result = gcd(a, b) | ||
print('GCD of {} and {} is {}'.format(a, b, result)) |