Basic

Java Program to Calculate Compound Interest

Here you will get java program to calculate compound interest. We can calculate compound interest by following formula. Compound Interest = Principle * (1 + Rate / 100) time Also Read: Java Program to Calculate Simple Interest

  Output Enter principle: 1000 Enter rate: 4 Enter time: 10 Compound Interest = 1480.2442849183444

Java Program for Addition of Two Numbers

Here you will get java program for addition of two numbers. It is the very basic java program that is useful for beginners.

  Output Enter first number: 8 Enter second number: 4 Sum = 12

Java Program to Swap Two Numbers

Here you will get java program to swap numbers using temporary variable. It can be done in following way. temp = a a = b b = temp Also Read: Java Program to Swap Two Numbers Without Using Third Variable

  Output Enter first number: 5 Enter second number: 8 Before swap: a = 5 …

Java Program to Swap Two Numbers Read More »

Java Program to Swap Two Numbers Without Using Third Variable

Here you will get java program to swap two numbers without using third variable or temporary variable. We can do this in 3 ways as mentioned below. Also Read: Java Program to Swap Two Numbers Using Temporary Variable   1. Using Addition & Subtraction Operator We can swap two numbers using addition (+) and subtraction (-) …

Java Program to Swap Two Numbers Without Using Third Variable Read More »