You are having a void main function! How old is your compiler and does not complain about this?
Anyway you have used your conditions wrong (boolean algebra should be inversed when a part is inverted). This means
A==B || A==C is equal to A!=B && A!=C
The correct is: while ((gender != 'm') && (gender != 'M') && (gender!= 'f' && gender != 'F'));