You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
function exp(b,n)
|
|
{
|
|
var ans = 1;
|
|
for (var i =1; i <= n; i++)
|
|
{
|
|
ans = b * ans;
|
|
}
|
|
return ans;
|
|
}
|
|
console.log(exp(2, 3));
|