Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by erykE ( 6 years ago )
#include <iostream>
using namespace std;
int main()
{
    unsigned int from; // zdefiniowanie zmiennej typu całkowitego
    unsigned int to;

    cout<< "Program wypisuje liczby parzyste z podanego przez Ciebie zakresu OD DO."<<endl;
    cout<< "Pod najpierw zakres OD:"<<endl;
    cin>>from; // przypisanie wprowadzonej przez użytkownika wartoci do zmiennej 
    cout<< "A teraz wartosc DO:"<<endl;
    cin>>to;

    if (from == to) {
        cout<< "Liczby są takie same, ogarnij czambo";
    } else if (from > to) {
         cout<< "Podany zakres OD jest większy niż zakres DO. Ten program działa tylko gdy OD jest mniejsze niż DO.";
    } else if (to >= 0) {
        cout<< "Liczby parzyste z podanego zakresu to:" <<endl;
        do {
            if (from % 2 == 0){
                cout<<from<<endl;
            }
            from++;
        } while 
            (from < to);
    } else {
         cout<< "Podano niepoprawne wartosci liczb. Wartosc DO musi byc większa niż 0.;";
    } 

    return 0;
}

 

Revise this Paste

Your Name: Code Language: