Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdio>
- using namespace std;
- float suma(float a,float b){
- float temp;
- temp=a+b;
- return temp;
- }
- float roznica(float a,float b){
- float temp;
- temp=a-b;
- return temp;
- }
- float iloczyn(float a ,float b){
- float temp;
- temp=a*b;
- return temp;
- }
- float iloraz (float a,float b){
- if(b==0){
- cout << "Blad dzielenia" << endl;
- return 0;
- }else{
- return a/b;
- }
- }
- int main(){
- float a,b,s=0,r=0,il=0,ilor=0;
- cout<<"Podaj wartosc a: ";
- cin>>a;
- cout<<"Podaj wartosc b: ";
- cin>>b;
- s=suma(a,b);
- r=roznica(a,b);
- il=iloczyn(a,b);
- ilor=iloraz(a,b);
- cout<<"suma wynosi: "<<s<<endl;
- cout<<"Roznica wynosi: "<<r<<endl;
- cout<<"Iloczyn wynosi: "<<il<<endl;
- cout<<"Iloraz wynosi: "<<ilor<<endl;
- getchar();
- return 0;
- }
Advertisement
Advertisement
Advertisement
RAW Paste Data
Copied
Advertisement