write a program to find the difference between compound interest and simple interest at program terminates as soon as the user enters the timer 0 equal to zero take the principal rate and time as input from the console using java
Answers
Answer:
Kgxfyfzz7txgccohcihcihcccichciuhchciihcihfihcihcihcihv coding and decoding
Eeror
Error
Error
Error
Answer:
Explanation:
import java.util.Scanner;
public class JavaApplication {
public static void main(String[] args) {
float p, r, t;
Scanner s = new Scanner(System.in);
System.out.print("Enter the Principal : ");
p = s.nextFloat();
System.out.print("Enter the Rate of interest : ");
r = s.nextFloat();
System.out.print("Enter the Time period : ");
t = s.nextFloat();
float si,ci;
si = (r * t * p) / 100;
ci = (float) (p* Math.pow((1 +r/100),t));
float Difference = (float) (ci-si);
System.out.println("The Simple Interest is : " + si);
System.out.println("The Compound Interest is : " + ci);
System.out.println(Difference);
}
}