Computer Science, asked by naweentigga78, 1 year ago

write a program to accept values of principle, rate and time and calculate simple interest,compound interest and difference between them.

Answers

Answered by Theinvincible
1
(100+r)/100 is written in there
Attachments:
Answered by prakriti27
1
import java.util.*;
class Interest
{
void main()
{
Scanner sn = new Scanner(System.in);
System.out.print("Enter the Principal: ");
double p = sn.nextDouble();
System.out.print("Enter the Rate: ");
double r = sn.nextDouble();
System.out.print("Enter the Time");
double t = sn.nextDouble();
double A = p*(Math.pow(((100+r)/100),t);
double CI = A-p;
double SI = (p*r*t)/100;
double d = CI-SI;
System.out.println("Simple Interest: "+SI);
System.out.println("Compound Interest: "+CI);
System.out.println("Diffrence: "+d);
}
}
Similar questions