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



Write a c program to Find the name that you entered is male name or female name? Such as Sunjay..

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

Write a c program to Find the name that you entered is male name or female name? Such as Sunjay..

Answer / arunkumar

It's not possible for all the names..

Is This Answer Correct ?    9 Yes 2 No

Write a c program to Find the name that you entered is male name or female name? Such as Sunjay..

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

Write a c program to Find the name that you entered is male name or female name? Such as Sunjay..

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

Write a c program to Find the name that you entered is male name or female name? Such as Sunjay..

Answer / anika

not possible as many names are common between both men and women

Is This Answer Correct ?    5 Yes 3 No

Post New Answer

More C Interview Questions

what is the function of void main()?

8 Answers  


Give the Output : * * * * * * * * * *

2 Answers  


How to write a C program to determine the smallest among three nos using conditional operator?

2 Answers   Google,


what is c programing

11 Answers   Wipro,


What is realloc in c?

0 Answers  






c language interview questions & answer

0 Answers  


Explain how can I open a file so that other programs can update it at the same time?

0 Answers  


How do I determine whether a character is numeric, alphabetic, and so on?

0 Answers  


What is the difference between char array and char pointer?

0 Answers  


How does normalization of huge pointer works?

0 Answers  


Is c procedural or functional?

0 Answers  


How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?

1 Answers  


Categories