Friday 4 July 2014

Write C# program to print the table of characters that are equivalent to the Ascii codes from 1 to 122.

The program will print the 10 characters per line.

Solution:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Csharp_exercises
{
class Program
{
static void Main(string[] args)
{

int i =1;
do
{
  Console.Write((char)i+"\t");
  if (i % 10 == 0)
    Console.Write("\n");

  i++;
} while(i<=122);

Console.ReadLine(); 
}
}
}




No comments:

Post a Comment