Write a c program to Find the name that you entered is male
name or female name?
Such as Sunjay is name of male and Payal is name of female
Answers were Sorted based on User's Feedback
Answer / seetaram
this very critical one.i don't know how verify names boy r girl in c
| Is This Answer Correct ? | 17 Yes | 6 No |
Answer / sanjay
it can be done when you have list of all the possible names
to be entered..otherwise it is nearlly imposible..
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / deepak kishore
it's not possible to right answer in 100% cases.
But in 80% cases answer will be right.
Ans in C#.
Console.WriteLine("Enter your Name to get gender");
string s = Console.ReadLine();
int len = s.Length;
char c =s[ len - 1];
if (c == 'a' || c=='A')
{
Console.WriteLine("Female");
}
else if (c == 'e' || c=='E')
{
Console.WriteLine("Female");
}
else if (c == 'i' || c=='I')
{
Console.WriteLine("Female");
}
else if (c == 'o' || c=='O')
{
Console.WriteLine("Female");
}
else if (c == 'u' || c=='U')
{
Console.WriteLine("Female");
}
else
{
Console.WriteLine("Male");
}
Console.ReadLine();
deepak.sonu786@gmail.com
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / anika
not possible as many names are common between both men and women
| Is This Answer Correct ? | 6 Yes | 3 No |
In which language linux is written?
Why should I use standard library functions instead of writing my own?
what is the use of macro program
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
How can I read a directory in a c program?
How to add two numbers without using semicolon at runtime
How can I find out if there are characters available for reading?
How can I read and write comma-delimited text?
print pattern 1 1 33 33 555 555 77777777 555 555 33 33 1 1
How to implement a packet in C
What tq means in chat?
How can I change their mode to binary?