//============================================================== // Funkcje;
// definicja funkcji, jej naglowek i prototyp. //
// ver data temat // 100 2001/10/11 Pierwszy projekt J.Mali // 102 2019/08/25 Cleanup //================================================================ #include <iostream> #include <math.h> using namespace std; //================================================================ // prototyp funkcji; definicja - nizej;
float Potega( float, int );
//================================================================ // definicja funkcji;
double Square( double x ) { return x*x; } //================================================================ // funkcja glowna; int main() { float x=0.5, y=2.5; int n=2;
cout << Potega( y, n ) << endl; cout << Square( x ) << endl; system("PAUSE");
return 0; }
//================================================================ // definicja funkcji;
float Potega( float y, int n ) {
float w=y;
for( int i=1; i<n; i++ ) w=w*y;
return w; }