Created
December 1, 2019 11:51
-
-
Save DominicFinn/912b52d6a441d9baf327cc5fecdc2fbd to your computer and use it in GitHub Desktop.
Reading a name and seeing what it begins with
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace leanne | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Enter name!"); | |
var name = Console.ReadLine(); | |
if (name.StartsWith("L")) | |
{ | |
Console.WriteLine("Welcome"); | |
} | |
else | |
{ | |
Console.WriteLine("Go away!"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment