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 are Structure passing and returning implemented by the complier?
Where static variables are stored in memory in c?
Why is %d used in c?
Can you apply link and association interchangeably?
What are the different categories of functions in c?
What does do in c?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
Is c language still used?
Explain what are the standard predefined macros?
What is 1f in c?
When c language was developed?
Explain how does free() know explain how much memory to release?
What is c definition?
Explain 'bit masking'?
How do c compilers work?