Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float a,b;
- void Pod2liczb(void)
- {
- cin>>a;
- cin>>b;
- }
- void dodawanie(void)
- {
- cout<<"Wynik dodawania to: ";
- cout<<a+b<<endl;
- }
- void odejmowanie(void)
- {
- cout<<"Wynik odejmowania to: ";
- cout<<a-b<<endl;
- }
- void mnozenie(void)
- {
- cout<<"Wynik mnozenia to: ";
- cout<<a*b<<endl;
- }
- int dzielenie()
- {
- if(a!=0)
- {
- cout<<"Wynik dzielenia to: ";
- cout<<a/b<<endl;
- }
- else
- {
- cout<<"Error,nie mozna dzielic przez 0"<<endl;
- return 0;
- }
- }
- int resztazdzielenia()
- {
- int c,d;
- c=a;
- d=b;
- if((c>0) && (d>0))
- {
- cout<<"Wynik reszty z dzielenia to: ";
- cout<<c%d<<endl;
- }
- else
- {
- cout<<"Error,liczby musza byc wieksze od 0"<<endl;
- }
- return 0;
- }
- int main()
- {
- Pod2liczb();
- dodawanie();
- odejmowanie();
- mnozenie();
- dzielenie();
- resztazdzielenia();
- cout<<"--------------------------------"<<endl;
- return main();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement