experiment
unknown
java
a month ago
471 B
1
Indexable
Never
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); } }