Java Program to Swap values using third variable

Java Program to Swap values using third variable

In Java, to swap two values using a third variable, we should know the concepts of operators and how to assign values. In this article we will learn swapping values using a third variable in java through an example, detailed logic and program explanation for better understanding. For example, if the two input numbers are … Read more

Calculate Power of a number using pow() in Java

Java Program to calculate power using pow() method

In this tutorial we will learn writing Java Program to calculate the power for the given base and exponents using Math.pow() method. If user enters base as 3 and exponent as 4, output should be 81. We will also learn with example, detailed logic and program explanation for better understanding. Required Knowledge Problem Statement We … Read more

Calculate Power in Java Without using pow()

Java program to calculate power without using pow() method

In java, to calculate power of a number without using pow method we can use loop concepts such as while loop or for loop. For the given base(number) and exponent (power) values, Power is calculated as multiplication of base to base for exponent times. If the input base is 2 and exponent is 5, output … Read more

Palindrome Number Program in Java

Palindrome Number Program in Java

In java, to check number is palindrome or not we can use loop concepts such as while loop or for loop. Palindrome number is defined as a number that is same even after reversing it. For example, 131 is a palindrome number. Writing from left to right or right to left will give same number … Read more

Java Program to find Strong numbers in a given range

Java Program to find Strong numbers in a given range

In java, to find all Strong numbers in a given range we can use loop concepts such as while loop or for loop. In this article, we will learn through examples, detailed logic and program explanation for better understanding. What is Strong Number? A “Strong number,” often referred to as a “factorial number” or a … Read more

Java program to check Perfect number

Java program to check Perfect number

In java, to check if a number is Perfect or not we can use loop concepts such as while loop or for loop. In this article, we are focusing on learning through examples, detailed logic and program explanation for better understanding. What is Perfect Number? A perfect number is defined as a positive integer that … Read more