Actually, if i dont input a number, the code is entering 3 times in the IF before ask for another input. (and it dont show the first "cout" message)Code:teste:
cout << "Nath, digite ate que numero deseja pesquisar por numeros primos.\n";
if(!(cin >> MAX)){
cout << "Erro! Apenas numeros sao validos! (0123456789)\n";
cin.clear();
cin.ignore();
goto teste;
return(0);
}
Why?
Thanks.