The or doesn't work for me in this while loop:
#include <iostream>
using namespace std;
main ()
{
char s;
do{
cout<<"\n\t\t> Ingrese el sexo: ";
cin>>s;
}while (s!='f' || s!='m');
return 0;
}
The or doesn't work for me in this while loop:
#include <iostream>
using namespace std;
main ()
{
char s;
do{
cout<<"\n\t\t> Ingrese el sexo: ";
cin>>s;
}while (s!='f' || s!='m');
return 0;
}
It doesn't work for you because instead of || (OR) you must use && (AND). Using OR the while condition will always be true because when it is 'f' it will not be 'm' ;-)