experiment
unknown
java
2 years ago
471 B
11
Indexable
import java.util.*;
public class exp {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int p = s.nextInt();
int t = s.nextInt();
float r = s.nextFloat();
float simpleInterest= (p*t*r)/100;
float compoundInterest= p*(float)Math.pow((1 + r),t) - p;
// Display the results
System.out.println("Simple Interest: " + simpleInterest);
System.out.println("Compound Interest: " + compoundInterest);
}
}Editor is loading...