public static void Main()
Console.Write("Enter your first name: ");
string firstName = Console.ReadLine().Trim().ToLower();
Console.Write("Enter your last name: ");
string lastName = Console.ReadLine().Trim().ToLower();
string reversedFirstName = "";
for (int i = firstName.Length - 1; i >= 0; i--)
reversedFirstName += firstName[i];
string reversedLastName = "";
for (int i = lastName.Length - 1; i >= 0; i--)
reversedLastName += lastName[i];
if (firstName == reversedLastName)
Console.WriteLine("The first name '"+firstName+"' is the palindrome of the last name '"+lastName+"'.");
Console.WriteLine("The first name '"+firstName+"' is not the palindrome of the last name '"+lastName+"'.");
if (lastName == reversedFirstName)
Console.WriteLine("The last name '"+lastName+"' is the palindrome of the first name '"+firstName+"'.");
Console.WriteLine("The last name '"+lastName+"' is not the palindrome of the first name '"+firstName+"'.");