Wednesday, November 7, 2012

c# - A to Z & a to z

Software Intern Interview question.Print A-Z using a loop

for (int iIndex = 65; iIndex <= 90; iIndex++)
    Console.WriteLine(((char)iIndex).ToString());



for (int iIndex = 97; iIndex <= 122; iIndex++)
     Console.WriteLine(((char)iIndex).ToString());



No comments: