Write a program to perform the function of a Simple Interest Calculator.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter number: ");
double num = in.nextDouble();
System.out.print("Enter persent: ");
double per = in.nextDouble();
System.out.printf("%.2f percent of %.2f = %.2f", per, num, ((per*num)/100));
}
}
Comments
Leave a comment