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 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