Repeat the “if” statement if it has to go to the “else” statement

Put the whole code block in a while loop
with
while((type!=1 && type!=2))
{
...
}

this will do the trick

Leave a Comment