๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ java-program-to-calculate-power-of-a-number
Java Program to Calculate Power of a Number - GeeksforGeeks
// Java program to find the power of a number // using Recursion class GFG { // Function to calculate N raised to the power P static int power(int N, int P) { if (P == 0) return 1; else return N * power(N, P - 1); } // Driver code public static ...
Published ย  July 12, 2025
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ home โ€บ java programs โ€บ java program to find power of a number
Java Program to find Power of a Number
January 22, 2025 - We initialized the integer i value to 1, and also (i <= exponent) condition helps the Javac to terminate when the condition fails. for(i = 1; i <= exponent; i++) { power = power * number; }
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ java โ€บ examples โ€บ calculate-the-power-of-a-number
Java Program to Calculate the Power of a Number | Vultr Docs
December 3, 2024 - This code snippet uses the Math.pow() ... Initialize a result variable to 1. Use a for loop to multiply the result by the base for the number of times specified by the exponent....
๐ŸŒ
Programiz
programiz.com โ€บ java-programming โ€บ examples โ€บ power-number
Java Program to Calculate the Power of a Number
Here, instead of using a while loop, we've used a for loop. After each iteration, the exponent is decremented by 1, and the result is multiplied by the base exponent number of times. Both programs above do not work if you have a negative exponent. For that, you need to use the pow() function ...
๐ŸŒ
Medium
rameshfadatare.medium.com โ€บ java-program-to-calculate-the-power-of-a-number-4e8f493e1c24
Java Program to Calculate the Power of a Number | by Ramesh Fadatare | Medium
December 13, 2024 - Using Math.pow(): The Math.pow() ... the base and the exponent. Using a Loop: A loop is used to multiply the base by itself as many times as indicated by the exponent....
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ Java-program-to-calculate-the-power-of-a-number
Java program to calculate the power of a number
import java.util.Scanner; public class PowerOfNumber { public static void main(String args[]){ Scanner sc = new Scanner(System.in); System.out.println("Enter the base number ::"); int base = sc.nextInt(); int temp = base; System.out.println("Enter the exponent number ::"); int exp = sc.nextInt(); ...
๐ŸŒ
W3codeworld
w3codeworld.com โ€บ article โ€บ 177 โ€บ java-program-to-calculate-the-power-of-n-number-using-for-loop-and-by-using-pow-function
Find Power of a Number in Java using For loop - W3CODEWORLD
// Find Power of a Number in Java using Math.pow() Function import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); double b, x, r; // b - To store base number // x - To store exponent number // r - To store result value ...
๐ŸŒ
BeginnersBook
beginnersbook.com โ€บ 2019 โ€บ 09 โ€บ java-program-to-calculate-power-of-a-number
Java Program to Calculate Power of a Number
In the following program, we are using pow() function to calculate power. public class JavaExample { public static void main(String[] args) { int number = 10, p = 3; double result = Math.pow(number, p); System.out.println(number+"^"+p+" = "+result); } } ... 1. Java program to find quotient ...
Find elsewhere
๐ŸŒ
Codingface
codingface.com โ€บ home โ€บ java โ€บ java logical programs โ€บ how to find power of a number in java โ€“ 3 simple ways
How To Find Power Of A Number In Java โ€“ 3 Simple Ways
June 22, 2021 - Read Also: Palindrome In Java(String ... taken while loop while(power != 0) to iterate till power value becomes 1. Similarly, as we discussed in for loop program, we will multiply the result with base value up to N times(In the example ...
๐ŸŒ
WsCube Tech
wscubetech.com โ€บ resources โ€บ java โ€บ programs โ€บ power-number
Java Program to Calculate the Power of a Number (7 Ways)
October 19, 2025 - Explore 7 different Java programs to calculate the power of a number. Learn methods using for loops, recursion, Math.pow(), and more. Ideal for learners!
๐ŸŒ
Javaprogramto
javaprogramto.com โ€บ 2020 โ€บ 11 โ€บ java-example-program-to-calculate-power-of-number.html
Java Program to Calculate the Power of a Number With Examples JavaProgramTo.com
Finding the power is to multiply ... integer type variables base and exponent. Next, run through the for loop for exponent times and multiply the base value those many times....
๐ŸŒ
YouTube
youtube.com โ€บ watch
Power of a Number in Java || Explained using loop and Math.pow() function - YouTube
#power of a #Number in Java using for loop and also using math.pow.Video Highlights:How do you find the power of a number in Java?How do you find the power o...
Published ย  August 23, 2022
๐ŸŒ
Learn Java
javatutoring.com โ€บ power-of-a-number-java-program
Java Program To Calculate Power Of Number | 4 Ways
3 weeks ago - Java Program To Calculate Power Of Number - In this article, we will detail in on the several ways t...
๐ŸŒ
Techcrashcourse
techcrashcourse.com โ€บ 2022 โ€บ 11 โ€บ java-program-find-power-of-number.html
Java Program to Calculate the Power of a Number
In this java program, we will learn about how to calculate the power of a number using loops, using Math.pow() method and using recursion.
๐ŸŒ
TutorialKart
tutorialkart.com โ€บ java โ€บ java-calculate-power-of-number
Java Program to Calculate Power of a Number
November 23, 2020 - To calculate power of a number, you can either user Math function pow(), or use a for loop, to multiply the number given number of times. pow() takes two numbers as arguments and calculate the first argument raised to the power of second argument.
๐ŸŒ
Javatpoint
javatpoint.com โ€บ power-of-a-number-in-java
Power of a Number in Java - Javatpoint
Power of a Number in Java with java tutorial, features, history, variables, object, programs, operators, oops concept, array, string, map, math, methods, examples etc.
๐ŸŒ
YouTube
youtube.com โ€บ slidenerd
37 Java Program Power Using For Loops | - YouTube
Launch Your First Android app with our TOP course at 82% OFF (24 hrs ONLY) HERE https://goo.gl/7veBXc "Learn How To Design + Code A Complete App From Scratch...
Published ย  January 29, 2013
Views ย  13K
๐ŸŒ
Studytonight
studytonight.com โ€บ java-programs โ€บ java-program-to-calculate-the-power-of-a-number
Java Program to Calculate the Power of a Number - Studytonight
Use a while loop to calculate the power of a number. Print the calculated value. ... Below is the code for the same. //Java Program to Calculate the Power of a number import java.util.Scanner; public class Main { public static void main(String[] ...