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
How do I determine whether a character is numeric, alphabetic, and so on?
Why do we write return 0 in c?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?
How do I use strcmp?
What is the difference between c and python?
what are the facialities provided by you after the selection of the student.
Why can’t we compare structures?
What is typeof in c?
What is the difference between strcpy() and memcpy() function in c programming?
What is pre-emptive data structure and explain it with example?
When should the register modifier be used? Does it really help?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is getch c?
What is the importance of c in your views?
Why main is not a keyword in c?