P010.c
Problem Statement
P010.c
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
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
● Author - Amit Dutta · Updated - 12 Dec 2025