Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

p*=(++q)++*--p when p=q=1 while(q<=6)

1764


what is the basis for selection of arrays or pointers as data structure in a program

4309


What is console in c language?

1101


What are the c keywords?

1207


Explain enumerated types in c language?

1052


int far *near * p; means

3562


List the difference between a "copy constructor" and a "assignment operator"?

1021


List a few unconditional control statement in c.

988


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2871


Difference between strcpy() and memcpy() function?

1155


What is substring in c?

1209


formula to convert 2500mmh2o into m3/hr

1000


What is scope rule of function in c?

1102


What is a keyword?

1172


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3690