Skip to content

Instantly share code, notes, and snippets.

@gagannn
Created September 16, 2019 10:48
Show Gist options
  • Save gagannn/696fe3c5b2408391b09e73b2667fe25e to your computer and use it in GitHub Desktop.
Save gagannn/696fe3c5b2408391b09e73b2667fe25e to your computer and use it in GitHub Desktop.
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