➽ Program:-
import java.util.*;
import java.io.*;
class Main
{
public static void
main(String args[])
{
double
principal_amount, rate, time, compound_interest;
Scanner
sc = new Scanner(System.in);
System.out.print("Enter a Principal Amount: ");
principal_amount = sc.nextDouble();
System.out.print("Enter time(in years): ");
time =
sc.nextDouble();
System.out.print("Enter Rate: ");
rate =
sc.nextDouble();
compound_interest = principal_amount * (Math.pow((1 + rate / 100), time));
System.out.println("Compound
Interest = " + compound_interest);
}
}
➽ Output:-
0 Comments
Please do not enter any spam link in the comment section.