MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / IterativePower

Function IterativePower

CPP/Maths/powerIterative.cpp:14–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace std;
13
14int IterativePower(int x,int n){
15 int res = 1;
16 while( n ){
17 if(n & 1){
18 res = res * x ;
19 }
20 x = x * x ;
21 n = n>>1;
22 }
23 return res;
24}
25
26int main(){
27int x,n;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected