 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C Program for compound interest?
Here we will see how to get the compound interest by writing one C program. The logic is very easy. Here we need some parameters −
- P − Principle amount
- R − Rate of interest
- T − Time span
The compound interest formula is like below

Example
#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)); }  Output
Enter Princple amount, rate of interest, and time: 5000 7.5 3 Interest value: 6211.485352
Advertisements
 