Hi:
Could someone please help?
I want to check if input valid or not. But my code doesn't stop as expected.
whats wrong with it?Code:void validateSex(char sex) { if ( sex != 'M' || sex != 'F') { printf("Input Error: Invalid \n"); do { printf("Enter your sex (M or F): "); scanf("%c", &sex); }while (sex !='M' || sex!='F'); }; /* End if */ }
Thanks