Unverified Commit 247b1221 authored by Lokesh Singh's avatar Lokesh Singh Committed by GitHub

Update Calculate power of a number

parent c901bfa8
...@@ -10,3 +10,11 @@ class HelloWorld { ...@@ -10,3 +10,11 @@ class HelloWorld {
System.out.println("result is "+result); System.out.println("result is "+result);
} }
} }
//calculating power using pow() method
public static void main(String[] args) {
int base = 2, exponent = 4;
double result = Math.pow(base,exponent);
System.out.println("result is "+result);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment