do while loop won't terminate

Here's the loop:

1
2
3
4
5
6
7
8
9
10
11
12
13
void feetToM()
{
    int start, end;
    
    do
    {
        cout << "Please enter a starting and ending number of feet to convert:" << endl;
        cin >> start >> end;
    }
    while (start<0 || start<end);

//other stuff
}


When I run the program it keeps outputting the above cout statement, even if I enter valid input. What's the problem?
Last edited on
The loop terminate when the condition start<0 || start<end becomes false. Example: start=0, end=-1 will terminate the loop.
Last edited on
Oops fixed to while (start<=0 || start>end);. Thanks
Just do

 
while(start < 0)
Use:
while(start<0);
Topic archived. No new replies allowed.