C Online Compiler
Example: Compound Interest Program in C language
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// Compound Interest Program in C language #include <stdio.h> #include <math.h> int main() { float p, t, r, CI; // p - To store the principle amount // t - To store the time amount // r - To store the rate amount // CI - To store the compound interest value printf("Enter the principal (Amount), Time, and Rate::\n"); scanf("%f%f%f", &p, &t, &r); // Calculate compound interest CI = p * (pow((1 + r / 100), t)); // It will return the final Output printf("\nCompound Interest = %f\n", CI); return 0; }
5 7 9
Output
Clear
ADVERTISEMENTS