Charan.java

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