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

उदाहरण
#include#include 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