Hello so i have been making a program and decided to start on error checking. I'm asking the user to input a 1 to continue and a 2 to exit simple. I worked the code out for the error checking though when i compiled and ran the program all it did was go into a endless loop. here is the code where the error is occuring.
//these are what the variables are declared as
double ran=0;
int error=0;
errorcheck:
error=false;
if(ran!=1 || ran!=2)
{
error=true;
}
while(error==true)
{
system("cls"); //it gets stuck in here it wont allow me to enter any thing it just repeats
cout<<"this is a incorrect value \nenter 1 to start\nor\nenter 2 to exit\n";
cout<<"answer here -->\t";
cin>>ran;
goto errorcheck;
}