Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int iloraz()
- {
- int a, b;
- cout<<"podaj naturalne liczby do ilorazu"<<endl;
- cin>>a;
- cin>>b;
- if (a<=0)
- {
- (a=-2);
- }
- if (b<=0)
- {
- (b=-1);
- }
- if (a<=-2)
- {
- cout<<"nie dziel przez zero!";
- return 0;
- }
- if (b<=-1)
- {
- cout<<"nie dziel przez zero!";
- return 0;
- }
- else
- {
- cout<<"wynik dzielenia to ";
- cout<<(a/b)<<endl;
- }}
- int main()
- {
- iloraz();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement