
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
C Program for the compound interest?
Compound interest is the simple interest that is compounded annually i.e. the interest will be calculated and added to the principal amount every year. This increases the overall interest as compared to simple interest. There is a different mathematical formula to calculate the compound interest. Lets see with the an example,
Input:p=5, r=4, t=5 Output:1.083263
Explanation
Compound Interest = Principle * (1 + Rate / 100)^time CI=5*(1+4/100)^5 CI=1.083263
Example
#include <iostream> #include <math.h> using namespace std; int main() { float p, r, t, ci; p=5; r=4; t=5; ci = p * pow((1 + r / 100), t) - p; printf("%f", ci); return 0; }
- Related Articles
- C Program for compound interest?
- Python Program for compound interest
- C++ Program to Calculate simple interest and compound interest
- Program to find compound interest in C++
- Java Program to Calculate the Compound Interest
- Java Program to calculate Simple Interest and Compound Interest
- Swift Program to Calculate simple interest and compound interest
- Haskell Program to Calculate simple interest and compound interest
- Kotlin Program to calculate Simple Interest and Compound Interest
- Java Program to calculate Compound Interest
- Swift Program to Calculate Compound Interest
- Kotlin Program to Calculate Compound Interest
- C Program for simple interest?
- Compare simple interest and compound interest.
- C++ program to find the rate percentage from compound interest of consecutive years

Advertisements