## Java Program to Calculate the Power of a Number

Example 1: Calculate power of a number using a while loop public class Power { public static void main(String[] args) { int base = 3, exponent = 4; long result…

Skip to content
##
Java Program to Calculate the Power of a Number

##
Java Program to Reverse a Number

##
Java Program to Count Number of Digits in an Integer

##
Java Program to Display Characters from A to Z using loop

##
Java Program to Find LCM of two Numbers

##
Java Program to Find GCD of two Numbers

##
Java Program to Display Fibonacci Series

##
Java Program to Generate Multiplication Table

##
Java Program to Find Factorial of a Number

##
Java Program to Calculate the Sum of Natural Numbers

Example 1: Calculate power of a number using a while loop public class Power { public static void main(String[] args) { int base = 3, exponent = 4; long result…

In this program we will learn to reverse any number wsing for loop and while loop. Ex: 12345 -> 54321 Method 1: Reverse a Number using a while loop in…

In this program we will learn using while loop and for loop and we will find the number of digits in an Integer. Method 1: Count Number of Digits in…

In this program we will learn how to print English Alphabets in Upper case and Lower case using for loop. Method 1: Display Uppercased A to Z using for loop…

In this program we will look at two methods of finding LCM of two numbers 1. by using GDC and 2. without using GDC Also, you should know what is…

First of all, you should understand what is GCD? GCD or also called HCF means Highest Common Factor or Greatest common divisor. GCD of two integers is the largest number…

First of all you need to know what is Fibonacci series? It is a series where next term is the sum of previous two terms. The first number of the…

Example 1: Generate Multiplication Table using for loop public class MultiplicationTable { public static void main(String[] args) { int num = 5; for(int i = 1; i <= 10; ++i)…

Example 1: Find Factorial of a number using for loop public class Factorial { public static void main(String[] args) { int num = 10; long factorial = 1; for(int i…

Example 1: Sum of Natural Numbers using for loop public class SumNatural { public static void main(String[] args) { int num = 100, sum = 0; for(int i = 1;…