Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int a,b;
- int main()
- {
- cout << "podaj dolny kraniec przedzialu" << endl;
- cin >>a;
- cout <<"podaj gorny kraniec przedzialu" << endl;
- cin >>b;
- if (a > b){
- int c;
- c = a;
- a = b;
- b = c;
- }
- for (int i = a; i <= b; i++){
- if (i%3==0) cout << "liczba " << i << " jest podzielna przez 3" << endl;
- else cout << "liczba " << i << " nie jest podzielna przez 3" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment