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 ? | 16 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 ? | 5 Yes | 3 No |
what is the function of void main()?
Give the Output : * * * * * * * * * *
How to write a C program to determine the smallest among three nos using conditional operator?
what is c programing
What is realloc in c?
c language interview questions & answer
Explain how can I open a file so that other programs can update it at the same time?
How do I determine whether a character is numeric, alphabetic, and so on?
What is the difference between char array and char pointer?
How does normalization of huge pointer works?
Is c procedural or functional?
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?