Menu
Coddy logo textTech

21. Compound Interest

Lesson 22 of 31 in Coddy's 30 Days of Logic Building in C++ course.

challenge icon

Challenge

Easy

Write a function to calculate the compound interest.

  • Input: Principal: 1000, Rate: 5, Time: 2, Compounds per year: 12
  • Output: 104.943

Try it yourself

float calculateCompoundInterest(float principal, float rate, float time1, float compounds) {
    // Write code here
    
}

All lessons in 30 Days of Logic Building in C++