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
What are the preprocessor categories?
What are enumerated types?
Explain what is the difference between the expression '++a' and 'a++'?
Explain what are the different data types in c?
How can I direct output to the printer?
What is function prototype?
what are the facialities provided by you after the selection of the student.
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What is main return c?
What is define directive?
Can you tell me how to check whether a linked list is circular?
What is hungarian notation? Is it worthwhile?
Tell us bitwise shift operators?
Differentiate between a structure and a union.
What are the __date__ and __time__ preprocessor commands?