A certain sum is invested at the rate of 10 % per annum for 3 years. Write a java program
to find and display the difference between compound interest (C.I) and simple interest (S.I).
Taking the sum as an input by function argument.
S.I = (P × R× T)/100 A= P× (1 + R/100)
Answers
Answered by
10
Answer:
Program:
import java.util.*;
public class BrainlyAnswer
{
public static void main(String args[ ])
{
Scanner in=new Scanner(System.in);
int p;
double si=0.0,amt=0.0,ci=0.0,d=0.0;
System.out.println("Enter the principal");
p=in.nextInt();
si=(p*10*3)/100.0;
amt=p*(Math.pow(1+r/100.0,3.0));
ci=amt-p;
d=ci-si;
System.out.println("The difference between simple interest and compound interest="+d);
}
}
Similar questions
World Languages,
1 month ago
English,
3 months ago
Chemistry,
3 months ago
English,
9 months ago
Math,
9 months ago
Political Science,
9 months ago