Question #186489

write a function to calculate the n power m using loop


1
Expert's answer
2021-04-27T18:33:31-0400
int power(int nint m) {
    int res = 1;
    for(int i=0; i<m; i++) {
        res *= n;
    }

    return res;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS