write a program in Java
wap to input principal rate and time then calculate the simple interest and compound interest
Answers
Answer:
import java.util.Scanner;
public class Simple_Interest
{
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;
si = (r * t * p) / 100;
System.out.print("The Simple Interest is : " + si);
}
}
Explanation:
JAVA
public class Celsius.
{
public static void main (String args[])
{ float Fahrenheit, Celsius;
Fahrenheit = 43;
Celsius = ((Fahrenheit-32)*5)/9;
System.out.println("Temperature in celsius is: "+Celsius);
}}