Computer Science, asked by prateekgupta19844, 10 hours ago

write a Java Program for to enter principal amount, rate of interest and time. Calculate and print the Simple interest and compound interest and difference between them.​

Answers

Answered by shivanshi1934
1

Answer:

Here is ur answer

import java.util.Scanner;

public class JavaExample

{

public static void main(String args[])

{

float p, r, t, sinterest;

Scanner scan = new Scanner(System.in);

System.out.print("Enter the Principal : ");

p = scan.nextFloat();

System.out.print("Enter the Rate of interest : ");

r = scan.nextFloat();

System.out.print("Enter the Time period : ");

t = scan.nextFloat();

scan.close();

sinterest = (p * r * t) / 100;

System.out.print("Simple Interest is: " +sinterest);

}

}

Similar questions