0 votes
148 views
in C programming by (98.9k points)
edited
C Program to Calculate Compound Interest

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
/* 
 * C program to calculate compound interest 
 */ 
   
#include <stdio.h>  
#include <math.h>  
   
int main() {  
    float principle, rate, time, amount, interest; 
    
    printf("Enter Principle\n");  
    scanf("%f", &principle);
    printf("Enter Rate of Interest\n");  
    scanf("%f", &rate);  
    printf("Enter Time\n");  
    scanf("%f", &time);  
   
     
    amount = principle * pow((1 + rate/100), time);  
    
    interest = amount - principle;
    printf("After %d Years\n", time);
    printf("Total Amount = %.4f\n", amount); 
    printf("Compound Interest Earned = %.4f", interest);  
   
    return 0;  
}

 

Related questions

0 votes
1 answer 161 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)
0 votes
1 answer 401 views
0 votes
1 answer 896 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)
0 votes
1 answer 104 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)
0 votes
1 answer 146 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

537 users

...