luistavares

Função para cálculo de potência

Aug 21st, 2012
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int potencia (int base, int exp){
  2.     int result, cont;
  3.     result = 1;
  4.     for (cont = 1; cont <= exp; cont++){
  5.         result = result * base;
  6.     }
  7.     return result;
  8. }
RAW Paste Data