This program finds the compound interest for the given inputs. This source code is written in Java.
This source code takes the inputs of principle, rate of interest and time. By entering the basic formulas we get the requires amount and compound interest by calculation.
Implemenation of the source code
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
double A=0,Pri,Rate,Time,t=1,CI;
Scanner S=new Scanner (System.in);
System.out.print("Enter Principal : " );
Pri=S.nextFloat();
System.out.print("Enter Rate : " );
Rate=S.nextFloat();
System.out.print("Enter Time : " );
Time=S.nextFloat();
Rate(1 + Rate/100);
for(int i=0;i<Time;i++)
t*=Rate;
A=Pri*t;
System.out.print("Amount : " +A);
CI=A-Pri;
System.out.print("\nCompound Interest : " + CI);
OUTPUT:
Submitted by Kajjayam Priya (Priya1414)
Download packets of source code on Coders Packet
Comments