akhilgendercode
unknown
csharp
23 days ago
487 B
2
Indexable
Never
#include <stdio.h> #include <string.h> int main(){ char name[10], gender; printf("Enter Gender:"); scanf(" %c",&gender); // Add a space before %c to ignore whitespace characters printf("Enter Name:"); scanf("%9s",name); // Limit the input to 9 characters to avoid buffer overflow if (strcmp(name, "akhil") == 0 || strcmp(name, "Akhil") == 0){ printf("Gender: Trans"); } else { printf("Gender: %c",gender); } return 0; }
Leave a Comment