bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_1 / tuition-c / P020.c

P020.c (761B)


      1 /* WAP to calculate and display the maturity amount
      2 taking the sum and number of days as input.
      3     No. of Days         Rate of Interest
      4     Upto 180 days       5.5 %
      5     181 to 364 days     7.5 %
      6     exact 365 days      9.0 %
      7     more than 365 days  8.5 %
      8 */
      9 
     10 #include <stdio.h>
     11 int main()
     12 {
     13     double nod, amt, s, i;
     14     printf("Enter the amount and the time in days : ");
     15     scanf("%lf %lf", &s, &nod);
     16     if (nod <= 180)
     17         i = (s * 5.5 * (nod / 365)) / 100;
     18     else if (nod > 180.0 && nod <= 364.0)
     19         i = (s * 7.5 * (nod / 365)) / 100;
     20     else if (nod == 365.0)
     21         i = (s * 9.0 * 1) / 100;
     22     else if (nod > 365.0)
     23         i = (s * 8.5 * (nod / 365)) / 100;
     24     amt = s + i;
     25     printf("Amount to be paid : %g", amt);
     26     return 0;
     27 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror