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
Answer Posted / 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 |
Post New Answer View All Answers
p*=(++q)++*--p when p=q=1 while(q<=6)
what is the basis for selection of arrays or pointers as data structure in a program
What is console in c language?
What are the c keywords?
Explain enumerated types in c language?
int far *near * p; means
List the difference between a "copy constructor" and a "assignment operator"?
List a few unconditional control statement in c.
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
Difference between strcpy() and memcpy() function?
What is substring in c?
formula to convert 2500mmh2o into m3/hr
What is scope rule of function in c?
What is a keyword?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.