The power of compounding against simple interest practically with coding|| c programming to print compound interest || program to calculate compound interest, compound amount, simple interest, simple amount

The power of compounding against simple interest practically with coding|| c programming to print compound interest || program to calculate compound interest, compound amount, simple interest, simple amount :

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

float compoundamount(float principle, float rate, float time)
{
float CA;
CA = principle * ((pow((1 + rate / 100), time)));
return CA;
}

float compoundinterest(float principle, float rate, float time)
{
float CI;
CI = principle * ((pow((1 + rate / 100), time)) — 1);
return CI;
}

float simpleinterest(float principle, float rate, float time)
{
float SI;
SI = (principle * rate * time) / 100;
return SI;
}

float simpleamount(float principle, float rate, float time)
{
float SA;
SA = principle + (principle * rate * time) / 100;
return SA;
}
int main(void)
{
float pa, r, tp;
float simpleInterest, simpleAmount, compoundAmount, compoundInterest;
printf(“Enter principle amount: “);
scanf(“%f”, &pa);
printf(“Enter rate amount: “);
scanf(“%f”, &r);
printf(“Enter time: “);
scanf(“%f”, &tp);


printf(“\n\n\n\t\t\t Comparison”);
printf(“\n\n\tSimplified result\t\tCompounded result”);
simpleInterest = simpleinterest(pa, r, tp);
compoundAmount = compoundamount(pa, r, tp);
compoundInterest = compoundinterest(pa, r, tp);
simpleAmount = simpleamount(pa, r, tp);
printf(“\nsimpleInterest: %.3f\t\tCompound Interest: %.3f”, simpleInterest, compoundInterest);
printf(“\nsimpleAmount: %.3f\t\tCompound Amount: %.3f”, simpleAmount, compoundAmount);




return 0;
}

Here is the program:

thanks you

--

--

--

Hey internet family, it’s your friend.. I am a c programmer and Welcome to my blog where I provide you c programming codes for free of cost no ads will shown

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Understanding Connectable Observable Sequences in RxSwift

Setting Up A Second Brain — A Personal Docs Story

Python Web Scraping Part: 3

Could enterprise software be re-engineered to behave like a consumer app?

Static binaries for a C++ application

Footy Project

How to Set Up a Headless Raspberry Pi

How To Get Commodities Global Market Prices In 2022

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Haster

Haster

Hey internet family, it’s your friend.. I am a c programmer and Welcome to my blog where I provide you c programming codes for free of cost no ads will shown

More from Medium

Class 10 Blog

Old Dog, New Tricks

Best Defensive Technique — Best Boxing Gym Singapor

PYTHON --> The coolest language ever…

Print Function in Jupyter notebook.