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

How many types of sorting are there in c?

0 Answers  


Explain how can type-insensitive macros be created?

0 Answers  


how can i get the string which is having two spaces at the end.suppose the string is "Hello World ".Now at the end i have two spaces.i need to print with that spaces .

1 Answers  


Is it fine to write void main () or main () in c?

0 Answers  


simple program of graphics and their output display

0 Answers   Elysium,






Why C language is a procedural language?

0 Answers   Ericsson,


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

0 Answers  


i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

2 Answers  


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

0 Answers  


Define and explain about ! Operator?

0 Answers  


Can you add pointers together? Why would you?

0 Answers  


What is nested structure with example?

0 Answers  


Categories