
- 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 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
- Related Articles
- C Program for the 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 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?
- Java Program to Calculate the Compound Interest
- Compare simple interest and compound interest.
- What is compound interest?

Advertisements