Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int potencia(int base,int exponente){
- int resultado=1;
- for(int i=1; i<=exponente; i++){
- resultado *=base;
- }
- return resultado;
- }
- int main(){
- cout << potencia(5,3) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement