Fandom

Scratchpad

PLE:Unidad4Ejercicio1

216,082pages on
this wiki
Add New Page
Discuss this page0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

#include <iostream>
#include <cstdio>
using namespace std;

int elevado( int x, int y);
int main()
{
        int a,b,result;
        cout<<"introduce un numero\n";
        cin>>a;
        cout<<"introduce el exponente\n";
        cin>>b;
        result= elevado(a,b);
        cout<<result;
        cin.ignore();
        cin.get();
}
int elevado(int x, int y)
{
         int res = 1;

        for(int i=0;i<y;i++)
        {

                res *= x;
        }
        return res;
}

Also on Fandom

Random wikia