Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float kasia (float liczba1, float *liczba2, float &liczba3, float *suma);
- int main()
- {
- float cyfra1, cyfra2, cyfra3, suma=0;
- float *wskaznik, *sumczan;
- wskaznik= &cyfra2;
- sumczan= &suma;
- cout << "Licze sume i srednia" << endl;
- cout<< "Podaj 3 liczby: "<<endl;
- cout <<"<< ";
- cin>>cyfra1;
- cout<<"<< ";
- cin>>cyfra2;
- cout<<"<< ";
- cin>>cyfra3;
- cout<<"Srednia cyfr wynosi: "<<kasia(cyfra1, wskaznik, cyfra2, sumczan)<<endl;
- cout<<"Suma liczb wynosi: "<<suma<<endl;
- return 0;
- }
- float kasia (float liczba1, float *liczba2, float &liczba3, float *suma)
- {
- float srednia;
- *suma= liczba1 + (*liczba2) + liczba3;
- srednia = *suma/3;
- return srednia;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement