Created
September 16, 2019 10:48
-
-
Save gagannn/696fe3c5b2408391b09e73b2667fe25e to your computer and use it in GitHub Desktop.
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; | |
using System.Collections.Generic; | |
namespace Lab3_List | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var names = new List<string> { "<name>", "Ana", "GY" }; | |
names.Add("Maria"); | |
names.Add("Bill"); | |
names.Add("GG"); | |
names.Remove("Ana"); | |
Console.WriteLine(names.Count); | |
var index = names.IndexOf("DJ"); | |
if (index != -1) | |
{ | |
Console.WriteLine($"The name {names[index]} is at {index}"); | |
} | |
names.Sort(); | |
foreach (var name in names) | |
{ | |
Console.WriteLine($"Hello {name.ToUpper()}!"); | |
} | |
//fibonacci(3); | |
Console.ReadKey(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment