JakubKaczmarek_123

z2

Dec 4th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int a,b;
  5. int main()
  6. {
  7. cout << "podaj dolny kraniec przedzialu" << endl;
  8. cin >>a;
  9. cout <<"podaj gorny kraniec przedzialu" << endl;
  10. cin >>b;
  11. if (a > b){
  12. int c;
  13. c = a;
  14. a = b;
  15. b = c;
  16. }
  17. for (int i = a; i <= b; i++){
  18.     if (i%3==0) cout << "liczba " << i << " jest podzielna przez 3" << endl;
  19.     else cout << "liczba " << i << " nie jest podzielna przez 3" << endl;
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment