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 |
What does the message "automatic aggregate intialization is an ansi feature" mean?
What is the purpose of the code, and is there any problem with it? unsigned int f( unsigned n ) { return –n & 7; }
What does malloc () calloc () realloc () free () do?
what is inline function?
How the c program is executed?
parkside's triangle.. create a program like this.. enter the size: 6 enter the seed: 1 output: 1 23 456 7891 23456 789123 sample2: enter the size: 5 enter the seed: 3 output: 3 45 678 9123 45678 parkside should not exceed 10 while its seed should only be not more than 9..
What is the maximum length of an identifier?
Explain the use of #pragma exit?
which of 'arrays' or 'pointers' are faster?
What is the difference between ‘g’ and “g” in C?
application attempts to perform an operation?
What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);