using System;
using System.Text;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace ConsoleApplication4
{
public class MainClass
{
public static void Main()
{
List<int> numbers = new List<int>() { 1, 9, 12, 8, 6, 3 };
Console.WriteLine(“Numbers before sorting”);
foreach(int number in numbers)
{
Console.WriteLine(number);
Console.ReadLine();
}
numbers.Sort();
Console.WriteLine(“Numbers after sorting”);
foreach (int number in numbers)
{
Console.WriteLine(number);
Console.ReadLine();
}
numbers.Reverse();
Console.WriteLine(“Numbers in descending order”);
foreach (int number in numbers)
{
Console.WriteLine(number);
Console.ReadLine();
}
List<string> alphabets = new List<string>() { “B”, “F”, “D”, “E”, “A”, “C” };
Console.WriteLine(“Alphabets before sorting”);
foreach (string alphabet in alphabets)
{
Console.WriteLine(alphabet);
Console.ReadLine();
}
alphabets.Sort();
Console.WriteLine(“Alphabets after sorting”);
foreach (string alphabet in alphabets)
{
Console.WriteLine(alphabet);
Console.ReadLine();
}
alphabets.Reverse();
Console.WriteLine(“Alphabets in descending order “);
foreach (string alphabet in alphabets)
{
Console.WriteLine(alphabet);
Console.ReadLine();
}
Customer Customer1 = new Customer()
{
ID = 101,
Name = “Malla”,
Salary = 5000
};
Customer Customer2 = new Customer()
{
ID = 102,
Name = “Mark”,
Salary = 7000
};
Customer Customer3 = new Customer()
{
ID = 119,
Name = “Mla”,
Salary = 5500
};
}
public class Customer
{
public int ID { get; set; }
public string Name { get; set; }
public int Salary { get; set; }
}
}
}
using System.Text;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace ConsoleApplication4
{
public class MainClass
{
public static void Main()
{
List<int> numbers = new List<int>() { 1, 9, 12, 8, 6, 3 };
Console.WriteLine(“Numbers before sorting”);
foreach(int number in numbers)
{
Console.WriteLine(number);
Console.ReadLine();
}
numbers.Sort();
Console.WriteLine(“Numbers after sorting”);
foreach (int number in numbers)
{
Console.WriteLine(number);
Console.ReadLine();
}
numbers.Reverse();
Console.WriteLine(“Numbers in descending order”);
foreach (int number in numbers)
{
Console.WriteLine(number);
Console.ReadLine();
}
List<string> alphabets = new List<string>() { “B”, “F”, “D”, “E”, “A”, “C” };
Console.WriteLine(“Alphabets before sorting”);
foreach (string alphabet in alphabets)
{
Console.WriteLine(alphabet);
Console.ReadLine();
}
alphabets.Sort();
Console.WriteLine(“Alphabets after sorting”);
foreach (string alphabet in alphabets)
{
Console.WriteLine(alphabet);
Console.ReadLine();
}
alphabets.Reverse();
Console.WriteLine(“Alphabets in descending order “);
foreach (string alphabet in alphabets)
{
Console.WriteLine(alphabet);
Console.ReadLine();
}
Customer Customer1 = new Customer()
{
ID = 101,
Name = “Malla”,
Salary = 5000
};
Customer Customer2 = new Customer()
{
ID = 102,
Name = “Mark”,
Salary = 7000
};
Customer Customer3 = new Customer()
{
ID = 119,
Name = “Mla”,
Salary = 5500
};
}
public class Customer
{
public int ID { get; set; }
public string Name { get; set; }
public int Salary { get; set; }
}
}
}