यहां हम देखेंगे कि एक सी प्रोग्राम लिखकर चक्रवृद्धि ब्याज कैसे प्राप्त करें। तर्क बहुत आसान है। यहाँ हमें कुछ मापदंडों की आवश्यकता है -
- P - मूल राशि
- R - ब्याज दर
- T - समयावधि
चक्रवृद्धि ब्याज सूत्र नीचे जैसा है

उदाहरण
#include<stdio.h>
#include<math.h>
float compoundInterest(float P, float T, float R) {
return P*(pow(1+(R/100), T));
}
int main() {
float p, t, r;
printf("Enter Princple amount, rate of interest, and time: ");
scanf("%f%f%f", &p, &r, &t);
printf("Interest value: %f", compoundInterest(p, t, r));
} आउटपुट
Enter Princple amount, rate of interest, and time: 5000 7.5 3 Interest value: 6211.485352