- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Program to calculate Compound Interest
Following is the program to calculate Compound Interest in Java −
Example
import java.io.*; public class Demo{ public static void main(String args[]){ double princ = 456000, rt = 9.75, tm = 7; double comp_int = princ *(Math.pow((1 + rt / 100), tm)); System.out.println("The compound interest for the given principle amount, rate and time is "+ comp_int); } }
Output
The compound interest for the given principle amount, rate and time is 874573.9655622267
A class named Demo contains the main function wherein a principal value, a rate and a time are initialized. The formula for compound interest, principal * ((1 + rate/100) power time) is initialized to a value and the output is calculated. This is displayed on the console.
- Related Articles
- Java Program to calculate Simple Interest and Compound Interest
- Java Program to Calculate the Compound Interest
- Swift Program to Calculate Compound Interest
- Kotlin Program to Calculate Compound Interest
- Swift Program to Calculate simple interest and compound interest
- Kotlin Program to calculate Simple Interest and Compound Interest
- C++ Program to Calculate simple interest and compound interest
- Haskell Program to Calculate simple interest and compound interest
- Calculate compound interest in JavaScript
- Java Program to Calculate Simple Interest
- How to Calculate Compound Interest using Golang code?
- Python Program for compound interest
- C Program for compound interest?
- Program to find compound interest in C++
- Swift Program to Calculate Simple Interest

Advertisements