Fandom

Scratchpad

PLE:Unidad4Ejercicio1

219,207pages on
this wiki
Add New Page
Discuss this page0 Share
#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;
}

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.

Also on Fandom

Random wikia