0
How can I change this code so that when you type in "m" you get the answer "You are male."?
3 Antworten
+ 4
The mistake occurs at line 8 as we are comparing an integer with a character.
This is possible as every character has a decimal equivalent like 'A' is 65, 'a' is 97 and so on.
Therefore, just change the data type at line 6 to char will do. 😉
0
So far- no matter which letter you type in-the only answer you get is "You are female."...
0
Zephyr Koo Ahhh-that's where I went wrong.Thanks a lot for the fast and elaborate response.😀