Do While error prints twice despite scanf

I am trying to teach myself C and decided to make a console project that would be a Basal Metabolic Weight/BMI/Calorie Calculator. Anyways I am stumped early on with this problem. Can anyone tell me where I went wrong? I have been racking my brain but haven't been able to figure it out. (But I am somewhat new at this) Thanks!!!

Instead try this; the leading space means skip space like the newline.

Code:

scanf(" %c", &tempGender);

Tim S.

"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

No. Putting the space is an (ugly) workaround about the misuse of the scanf() function.
What you should do is understand why the space works, and what are the better alternatives.

1) scanf() was designed to work with formatted data (and it has very limited error validation/checking/recovery).
2) User input has no resemblance at all to formatted data
3) scanf() and user input are mostly incompatible
4) prefer to use fgets() to get a full line from the user
5) parse that line with, for example, sscanf().
6) ignore the fact your program is a few lines longer: it is also very many times more solid.

Thank you for taking the time to explain this to me. I will definitely run through more tutorials and try to get a better understanding between the different syntax options and uses. I have only done a little Visual Basic at a beginner level. Thank you again