Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int potega (int podstawa, int wykladnik)
- {
- int a=1;
- for(int i=1; i<=wykladnik; i++)
- {
- a=a*podstawa;
- }
- return a;
- }
- int main()
- {
- int a;
- int b;
- cout<<"Podaj podstawe: "<<endl;
- cin>>a;
- cout<<"Podaj wykladnik: "<<endl;
- cin>>b;
- cout<<"Wynik potegi: "<<potega(a,b)<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement