Charan.java

mail@pastecode.io avatar
unknown
java
8 months ago
524 B
1
Indexable
Never
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);
}
}