I have a problem with C#
enter image description here enter image description here this is what i am gonna do I try to covert string to int, it still no active.
THIS IS MY FULL CODE!
using System;
namespace New
{
class Program
{
public static string lastWord(string []a)
{
string word = a[0];
foreach (string s in a)
if (s > word) //ERROR
{
word = s;
}
return word;
}
public static void Main(string[] args)
{
Console.WriteLine("Please enter 3 words, separated by a space: ");
string input = Console.ReadLine();
string[] nameArr = input.Split(" ");
string name = lastWord(nameArr);
Console.WriteLine("The word that comes last is " + name);
}
}
}