![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 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; }
Advertisements