From 85037d56ad8dc6de9d18475039bbe787d0916c2e Mon Sep 17 00:00:00 2001 From: Jivan Dandapat Date: Mon, 10 Oct 2022 19:44:43 +0530 Subject: [PATCH 1/2] codes --- salary.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 salary.c diff --git a/salary.c b/salary.c new file mode 100644 index 0000000..7dbdf00 --- /dev/null +++ b/salary.c @@ -0,0 +1,20 @@ +#include +int main() +{ + int d1,d2,d3,d4,d5,n; + long int sum; + printf("enter a five digit nmber:"); + scanf("%d",&n); + d1=n%10; + n=n/10; + d2=n%10; + n=n/10; + d3=n%10; + n=n/10; + d4=n%10; + n=n/10; + d5=n%10; + sum=d1+d2+d3+d4+d5; + printf("\n the sum of digit is:%ld",sum); + return 0; +} \ No newline at end of file From 1f50cac8276b5c902bf5c7326f0dd49b31f8e811 Mon Sep 17 00:00:00 2001 From: Jivan Dandapat Date: Mon, 10 Oct 2022 20:13:06 +0530 Subject: [PATCH 2/2] added --- si.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 si.py diff --git a/si.py b/si.py new file mode 100644 index 0000000..4362358 --- /dev/null +++ b/si.py @@ -0,0 +1,12 @@ +def simple_interest(p,t,r): + print('The principal is', p) + print('The time period is', t) + print('The rate of interest is',r) + + si = (p * t * r)/100 + + print('The Simple Interest is', si) + return si + +# Driver code +simple_interest(8, 6, 8) \ No newline at end of file