raises base to nth power where n is greater than or equal to zero: - C Function

C examples for Function:Utility Function

Description

raises base to nth power where n is greater than or equal to zero:

int power(int base, int n){
  int po;
  for(po = 1; n > 0; --n)
    po = po * base;
  return(po);
}

Related Tutorials