0
How to write a code that asks for a persons gender and displays it? Am new to C btw. Is the code like this??
{ Char gender; Printf("\nEnter M or F for your gender\n"); Scanf("%d",&gender); Printf( "your gender is %d",&gender); }
2 Antworten
+ 8
If you are taking "char" as a data type you should use %c instead of %d.
And well if you use char data type you will be able to store only one character.
Hope you like that answer. If there is anything else, feel free to ask me.