Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float a;
- float b;
- float sqr(float a, float b)
- {
- int i;
- float wynik = 1;
- for(i=0;i<b;i++)
- {
- wynik = wynik * a;
- }
- return wynik;
- }
- main ()
- {
- cout << "Potege jakiej liczby chcesz uzyskac: ";
- cin >> a;
- cout << "Do ktorej potegi chcesz ja podniesc: ";
- cin >> b;
- cout << "Liczba " << a << " podniesiona do potegi " << b << " wynosi: " << sqr(a,b) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement