Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i;
- int x, y;
- int tymczasowa;
- cout << "Podaj pierwszy kraniec przedzialu" << endl;
- cin >> x;
- cout << "Podaj drugi kraniec przedzialu" << endl;
- cin >> y;
- if (y < x)
- {
- tymczasowa = y;
- y = x;
- x = tymczasowa;
- }
- cout << "\n";
- for (i = x; i <= y; i++)
- {
- if (i % 3 == 0)
- {
- cout << i << " liczba jest podzielna przez 3" << endl;
- }
- else
- {
- cout << i << " liczba nie podzielna przez 3" << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement