illegal else without matching if

i have looked up past discussions about this and i have retyped a few things to try to make it work but i cant figure out why its giving e this error. please some one help.

#include <iostream>
using namespace std;
int main()

{
bool first = true;
string input;
int i = 0;
cout << " This progam will find the minimum positive number input." << endl;
cout << " Entering a negative number will stop the input." << endl;
cout << " Enter a positive number (negative number to quit): ";
cin >> i;
while (i <= 0)
{
if (i >= 0)
int min = i;
else (0 != i);

cout << i << " is not a valid input" << endl;

if (bool first = false);
else (i == 0);
break;
}
{
else
if (i < 0);
int min = i;
else (0 != i);
cout << i << " is not a valid number. " << endl;
if (bool first = false);



}



return 0;

}
Could you apply code tags?
http://www.cplusplus.com/articles/z13hAqkS/

The error is near the bottom.

It looks like you don't understand the syntax for if and else statements; I'd work on that and see if that helps.
http://www.cplusplus.com/doc/tutorial/control/#ifelse
Topic archived. No new replies allowed.