P010.c ​
Metadata ​
- Author — Amit Dutta (amitdutta4255@gmail.com)
- Last updated — 12 Dec 2025
- License — MIT
Problem Statement ​
Problem Statement
WAP to find and display the difference between compound Interest and Simple Interest. Take principle amount as input. Hint : si = (p * r * t) / 100 a = p * ((1 + (r / 100)) ^ t) ci = a - p
Source Code ​
Printing the code
To print this file, open it on GitHub and click Raw before printing, or use the Download Raw button above and print directly from that page.
c
#include<stdio.h>
#include<math.h>
int main() {
double p, r, t, si, a, ci, dif;
printf("Enter the principle amount, rate of interest, time in year : ");
scanf("%lf %lf %lf", &p, &r, &t);
si = (p * r * t) / 100;
a = p * pow((1 + (r / 100)), t);
ci = a - p;
dif = ci - si;
printf("\nSimple Interest : %lf"
"\nCompound Interest : %lf"
"\nInterest Difference : %lf", si, ci, dif);
return 0;
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15