এখানে আমরা দেখব কীভাবে একটি সাধারণ C প্রোগ্রাম দিয়ে চক্রবৃদ্ধি ব্যাজ বের করা যায়। লজিকটি খুব সহজ। এখানে কিছু প্যারামিটার দরকার −
- P − মূলধন (Principle amount)
- R − ব্যাজের হার (Rate of interest)
- T − সময়কাল (Time span)
চক্রবৃদ্ধি ব্যাজের ফর্মুলা নিচের মতো −

উদাহরণ
#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