0 votes
159 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 211 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)
0 votes
1 answer 417 views
0 votes
1 answer 968 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)
0 votes
1 answer 122 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)
0 votes
1 answer 163 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

554 users

...