using System;
using System.Collections.Generic;
using System.Linq;
namespace MainPrograms
{
public class Program
{
public static void Main(string[] args)
{
// Loop from a thru z (lower case alphabets)
for (char i = 'a'; i <= 'z'; i++)
{
Console.Write(i+" ");
}
//Another way to print lower case alphabets
//for (int i = 0; i < 26; i++)
//{
// Console.Write(Convert.ToChar(i + (int)'a') + " ");
//}
Console.WriteLine();
// Loop from A thru Z (upper case alphabets)
for (char i = 'A'; i <= 'Z'; i++)
{
Console.Write(i+" ");
}
//Another way to print uppercase case alphabets
//for (int i = 0; i < 26; i++)
//{
// Console.Write(Convert.ToChar(i + (int)'A') + " ");
//}
Console.WriteLine();
Console.ReadKey();
}
}
}
No comments:
Post a Comment