Unverified Commit c901bfa8 authored by Lokesh Singh's avatar Lokesh Singh Committed by GitHub

Create Calculate power of a number

parent 2062b261
class HelloWorld {
public static void main(String[] args) {
int base = 2, exponent = 4, result = 1;
while(exponent!=0)
{
result = result * 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