P010.c (751B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* WAP to find and display the difference 8 between compound Interest and Simple Interest. 9 Take principle amount as input. 10 Hint : si = (p * r * t) / 100 11 a = p * ((1 + (r / 100)) ^ t) 12 ci = a - p 13 */ 14 15 #include<stdio.h> 16 #include<math.h> 17 int main() { 18 double p, r, t, si, a, ci, dif; 19 printf("Enter the principle amount, rate of interest, time in year : "); 20 scanf("%lf %lf %lf", &p, &r, &t); 21 si = (p * r * t) / 100; 22 a = p * pow((1 + (r / 100)), t); 23 ci = a - p; 24 dif = ci - si; 25 printf("\nSimple Interest : %lf" 26 "\nCompound Interest : %lf" 27 "\nInterest Difference : %lf", si, ci, dif); 28 return 0; 29 }