Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*wersja ***/
- #include <iostream>
- using namespace std;
- float a,b;
- float iloraz(float a, float b)
- {
- if(a>0&&b>0)
- {
- return a/b;
- }
- else if (b==0)
- {
- return -1;
- }
- else
- {
- return -2;
- }
- }
- int main()
- {
- cout << "Podaj liczby" << endl;
- cin >> a;
- cin >> b;
- if (iloraz(a,b)==-1)
- {
- cout << "Nie dziel przez 0";
- }
- else if (iloraz(a,b)==-2)
- {
- cout << "Nie dziel przez 0";
- }
- else
- {
- cout << iloraz(a,b);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement