Computer Science, asked by mahatochnimai, 3 months ago

A certain sum is invested at the rate of 10 % per annum for 3 years. Write a java program

to find and display the difference between compound interest (C.I) and simple interest (S.I).

Taking the sum as an input by function argument.

S.I = (P × R× T)/100 A= P× (1 + R/100)​

Answers

Answered by kamalrajatjoshi94
10

Answer:

Program:

import java.util.*;

public class BrainlyAnswer

{

public static void main(String args[ ])

{

Scanner in=new Scanner(System.in);

int p;

double si=0.0,amt=0.0,ci=0.0,d=0.0;

System.out.println("Enter the principal");

p=in.nextInt();

si=(p*10*3)/100.0;

amt=p*(Math.pow(1+r/100.0,3.0));

ci=amt-p;

d=ci-si;

System.out.println("The difference between simple interest and compound interest="+d);

}

}

Similar questions