Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int i, liczba;
- cout << "Podaj liczbe: " << endl;
- cin >> liczba;
- cout << "Kolejne parzyste liczby naturalne od 0 do " << liczba << ":" << endl;
- for (i=0;i<=liczba;i++) {
- if (i % 2 == 0) {
- cout << i;
- if (i != liczba && i != liczba-1) {
- cout << ", ";
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement