Computer Applications
Write a Java program to obtain principal amount, rate of interest and time from user and compute simple interest.
Java
Java Operators
27 Likes
Answer
import java.util.Scanner;
public class KboatSimpleInterest
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter principal: ");
double p = in.nextDouble();
System.out.print("Enter rate: ");
double r = in.nextDouble();
System.out.print("Enter time: ");
int t = in.nextInt();
double si = p * r * t / 100;
System.out.println("Simple Interest: " + si);
}
}Output

Answered By
10 Likes
Related Questions
Evaluate the expression when x is 4:
x += x++ * ++x % 2;
Evaluate the given expression when the value of a=2 and b=3
b*=a++ - ++b + ++a; System.out.println("a= "+a); System.out.println("b= "+b);Identify the operator that gets the highest precedence while evaluating the given expression:
a + b % c * d - e
- +
- %
- -
- *