vendredi 19 juin 2015

Error w/declaration on else statement (C++)

#include <iostream>

using namespace std;

// Range of numbers, handles input in which the first number is smaller than the second.

int main()
{
    int max = 10;
    int min = 0;
    while(cin >> min)
    {
        if(min<max)
        {
            ++min;
            cout << "The number inputted is well in the RANGE: " << min << endl;
        else
        {
            cout << "The number inputted is not in the RANGE: " << max << endl;
        }
    }
} // End of if.
}

What's going on? Why isn't this working? I'm new to Stack so I tried posting this, er any help?

Aucun commentaire:

Enregistrer un commentaire