7:23 pm - Saturday December 20, 2014

Java program for to find power using Math formula


*@author :CandidJava.com

*@descriptions : This program  using  to find power using Math formula which is in <a href="http://www.exampledepot.com/egs/java.math/pkg.html">java.math</a> package


class Power {

public static void main(String args[]) {

//declare two variables in double

double x1,x2;

//using Math.pow() find the power of given number


x2= Math.pow(4,2);

//Print the values of x1 and x2

System.out.println("The  value is "+x1);

System.out.println("the value is"+x2);





D:\ Candidjava\Code >javac Power.java

D:\ Candidjava\Code >java Power

TheĀ  value is 15625.0

The value is16.0


Filed in: Z-A All Java Codes

No comments yet.

Leave a Reply